Skip to main content
Fully client-side · IPv4 + IPv6

CIDR / subnet calculator.

Convert any CIDR notation into the network address, broadcast, usable host range, host count, netmask, and wildcard mask. Calculation runs in your browser — nothing is sent to our servers.

Network
192.168.1.0/24
Address family
IPv4
Netmask
255.255.255.0
Wildcard mask
0.0.0.255
First host
192.168.1.1
Last host
192.168.1.254
Broadcast
192.168.1.255
Usable hosts
254 (of 256 total)

What this tool does

CIDR — Classless Inter-Domain Routing — is the notation we use to describe a contiguous range of IP addresses. 10.0.0.0/24 means “the 256 addresses starting at 10.0.0.0,” because the /24 says the first 24 bits are the network and the remaining 8 are host space. This calculator takes any IPv4 or IPv6 block in that notation and expands it into the network address, broadcast, usable host range, total host count, netmask, and wildcard mask. Every value is computed in your browser — nothing is sent to a server — so it works offline and never sees your data.

How the prefix length works

An IPv4 address is 32 bits; an IPv6 address is 128. The number after the slash is the prefix length: how many leading bits are fixed as the network portion. Everything to the right is host space that the block can address. Each bit you move the boundary changes the block size by a factor of two — a /25 is half the size of a /24, a /23 is twice as large. To get the total number of addresses, raise 2 to the power of the host bits (address width minus prefix length). A /26 on IPv4 therefore has 2(32−26) = 26 = 64 addresses. This doubling-and-halving is the whole mental model behind subnetting, and it is why prefixes are far easier to reason about than the old dotted-decimal masks.

How to read the results

  • Network address — the first address in the block. By convention, this isn't assignable to a host on classful IPv4 segments.
  • Broadcast address (IPv4 only) — the last address. Also not assignable to a host; sending to it reaches every device on the segment.
  • First/Last host — the range you can actually hand out to devices.
  • Netmask — the same prefix length expressed as a dotted-quad mask. /24 is 255.255.255.0.
  • Wildcard mask — the bitwise inverse of the netmask. Cisco ACLs use it.
  • Usable hosts — total addresses minus 2 (network + broadcast) for IPv4 on /30 and shorter. /31 point-to-point links use both endpoints (RFC 3021). /32 is a single host. IPv6 has no broadcast, so every address in a prefix is usable.

Common subnet sizes

PrefixMaskUsable hostsTypical use
/30255.255.255.2522Point-to-point WAN link
/29255.255.255.2486Small office segment
/28255.255.255.24014Small LAN
/24255.255.255.0254Standard home/office subnet
/22255.255.252.01022Mid-size office
/16255.255.0.065,534Large enterprise
/8255.0.0.016,777,214Legacy “Class A” allocations

Common use cases and pitfalls

  • Sizing a subnet. Work backwards from the number of hosts you need: a segment for 30 devices needs at least a /26 (62 usable hosts) rather than a /27 (30 usable), because the network and broadcast addresses consume two slots.
  • Writing firewall and ACL rules. Use the netmask for most systems and the wildcard mask for Cisco IOS access lists — they are inverses of each other, and mixing them up is a classic source of rules that silently match nothing.
  • Off-by-one boundaries. A common mistake is assuming a host can use the network or broadcast address. On standard IPv4 segments it cannot; only the addresses between first host and last host are assignable.
  • IPv6 is different. There is no broadcast address and the blocks are astronomically large, so “usable hosts” stops being a meaningful number. A single /64 is the standard size for one LAN.

Frequently asked questions

Why does a /24 have 256 addresses but only 254 usable hosts?

A /24 contains 256 total addresses (28). On a normal IPv4 subnet the first is reserved as the network address and the last as the broadcast address, neither assigned to a host, which leaves 254. The /31 and /32 prefixes are special cases that do not follow this rule.

How do I calculate the number of hosts in a subnet?

Subtract the prefix length from the address width (32 for IPv4, 128 for IPv6) to get the host bits, then raise 2 to that power for the total. For IPv4 prefixes of /30 or shorter, subtract 2 for the network and broadcast addresses to get usable hosts. IPv6 has no broadcast, so every address counts.

What is the difference between a netmask and a wildcard mask?

A netmask marks network bits with ones and host bits with zeros — /24 is 255.255.255.0. A wildcard mask is its exact bitwise inverse, 0.0.0.255, marking the bits allowed to vary. Cisco ACLs use wildcard masks; most other systems use netmasks.

Related tools

Pair this with the CIDR aggregator to merge adjacent blocks into the shortest prefix list, the WHOIS / RDAP lookup to see which organisation holds an allocation, and the IP-to-decimal converter for the integer form of any address. New to IPv6 ranges? Start with the IPv6 tools.