# IP Subnet Calculator

> Enter an IPv4 address and prefix length (CIDR) to get the network and broadcast addresses, subnet mask, wildcard mask and usable host range.

Category: IT, networking & security · Applies to: Worldwide · Last updated: 2026-10-29
Interactive calculator: https://calculators.geekmidst.com/calculators/ip-subnet-calculator

An IPv4 prefix such as /24 says how many leading bits identify the network. The rest identify hosts, which fixes the network address, the broadcast address and how many devices fit.

Also called: CIDR calculator, Subnet mask calculator.

## Inputs
- IPv4 address (default 192.168.1.10)
- Prefix length (CIDR) (unit bits; default 24)

## Results
- Network (CIDR)
- Network address
- Broadcast address
- First usable host
- Last usable host
- Usable hosts
- Total addresses
- Subnet mask
- Wildcard mask
- Mask in binary
- Address type

## Formula

```
Block size = 2^(32 − prefix);  Network = ⌊address ÷ block⌋ × block;  Broadcast = Network + block − 1;  Usable hosts = block − 2 (2 for /31, 1 for /32)
```

Where:
- prefix: number of network bits (0–32)
- block: number of addresses in the subnet

## Worked example
1. A /24 leaves 32 − 24 = 8 host bits, so the block is 2⁸ = 256 addresses.
2. The network address keeps the first three octets and sets the last to 0: 192.168.1.0.
3. The broadcast address sets all host bits to 1: 192.168.1.255.
4. Usable hosts are 256 − 2 = 254, from 192.168.1.1 to 192.168.1.254.

**Result:** 192.168.1.10/24 is in network 192.168.1.0/24, with 254 usable addresses from .1 to .254 and mask 255.255.255.0.

## What the result means

Devices on the same subnet talk directly; anything outside goes through a router. Pick the smallest subnet that leaves room to grow: a /26 holds 62 hosts, a /25 126 and a /24 254.

## Assumptions and limits
- IPv4 only.
- The network and broadcast addresses are not assigned to hosts, except in /31 point-to-point links (RFC 3021) and single-host /32 routes.
- IPv6 subnets are not calculated.
- Address type labels cover the main special ranges (private, loopback, link-local, CGNAT, multicast), not every reserved block.

## Questions

### What is a wildcard mask?

The inverse of the subnet mask (0.0.0.255 for /24). Cisco access lists and OSPF use it to say which bits may vary.

### Why are two addresses not usable?

In a normal subnet the all-zeros host address names the network itself and the all-ones address is the broadcast address.

## Related calculators
- [Password Generator](https://calculators.geekmidst.com/calculators/password-generator)
- [Conversion Calculator](https://calculators.geekmidst.com/calculators/conversion-calculator)

Source: GM¹X CalcVerse — https://calculators.geekmidst.com/calculators/ip-subnet-calculator
