Back to tool
Tools / CIDR Subnet
Calculate

CIDR Subnet Calculator

Network and broadcast address, usable host range, subnet and wildcard mask — with /31 and /32 handled correctly and the RFC scope identified.

IPv4 Subnet Analysis

ready
Pasting here overrides the fields above. Both 192.168.1.0/24 and 192.168.1.0 255.255.255.0 are accepted.
Network
Subnet mask
Wildcard
Broadcast
Total addresses
Usable host range
Usable hosts
Scope
Binary breakdown
You might also need
Base64 Encoder & DecoderUnix Timestamp ConverterNumber Base Converter

What CIDR notation means

CIDR — Classless Inter-Domain Routing — writes a network as an address followed by a slash and a number: 192.168.10.0/24. The number is the prefix length: how many of the 32 bits identify the network, leaving the rest to identify hosts within it.

The split
192.168.10.130/24

11000000.10101000.00001010.10000010  address
11111111.11111111.11111111.00000000  mask (24 ones)
┌──── 24 network bits ────┐┌ 8 host bits ┐

Everything else follows from that one number. The subnet mask is simply the prefix written as a dotted quad. The network address is the address with all host bits set to zero. The broadcast address is the same with all host bits set to one. Total addresses is 2 raised to the number of host bits.

The four formulas
Network   = address AND mask
Broadcast = network OR wildcard
Total     = 2(32 − prefix)
Usable    = total − 2  (except /31 and /32)

Why you lose two addresses

In an ordinary subnet, two addresses are structurally reserved and cannot be assigned to any host:

So a /24 has 256 total addresses and 254 usable ones. This is the source of the constant off-by-two confusion when sizing networks: if you need 254 hosts a /24 works, but if you need 255 you must move up to a /23 and jump straight to 510 usable.

Two exceptions. /31 is defined by RFC 3021 for point-to-point links, where there is no need for a broadcast address because there is exactly one other device — so both addresses are usable. /32 describes a single host and is used for loopback interfaces, host routes and firewall rules. This calculator handles both correctly rather than reporting a nonsensical −1 or 0 usable hosts.

A worked example

Analysing 192.168.10.130/26:

  1. Prefix 26 means 26 network bits and 6 host bits.
  2. Mask: 26 ones then 6 zeros = 255.255.255.192
  3. Block size: 2⁶ = 64, so subnets start at .0, .64, .128, .192
  4. Network: 130 falls in the .128 block → 192.168.10.128
  5. Broadcast: 128 + 64 − 1 = 192.168.10.191
  6. Usable range: 192.168.10.129 to 192.168.10.190
  7. Usable hosts: 64 − 2 = 62

The shortcut experienced network engineers use is the block size: 256 minus the interesting octet of the mask. Here 256 − 192 = 64, so subnet boundaries fall every 64 addresses. Find which block your address lands in and you have the network and broadcast immediately, without any binary.

Prefix reference

PrefixMaskTotalUsableTypical use
/8255.0.0.016,777,21616,777,214Very large private range
/16255.255.0.065,53665,534Campus / large site
/22255.255.252.01,0241,022Large office VLAN
/23255.255.254.0512510Medium VLAN
/24255.255.255.0256254Standard LAN segment
/25255.255.255.128128126Split /24
/26255.255.255.1926462Small department
/27255.255.255.2243230Small VLAN, DMZ
/28255.255.255.2401614Server rack, firewall zone
/29255.255.255.24886Small server group
/30255.255.255.25242Traditional point-to-point link
/31255.255.255.25422Modern point-to-point (RFC 3021)
/32255.255.255.25511Single host route

Reserved and special ranges

The calculator identifies which special-purpose range an address belongs to, because using the wrong one causes routing problems that are tedious to diagnose.

RangeNameNotes
10.0.0.0/8Private (RFC 1918)16.7M addresses, not routed on the internet
172.16.0.0/12Private (RFC 1918)172.16 through 172.31 only — not the whole 172 block
192.168.0.0/16Private (RFC 1918)The home-router default
100.64.0.0/10CGNAT (RFC 6598)Carrier-grade NAT; do not use internally
127.0.0.0/8LoopbackAn entire /8 for localhost
169.254.0.0/16Link-localSelf-assigned when DHCP fails — a diagnostic signal
224.0.0.0/4MulticastNot assignable to hosts

Wildcard masks

A wildcard mask is the bitwise inverse of a subnet mask — a /24 mask of 255.255.255.0 has a wildcard of 0.0.0.255. Cisco ACLs and OSPF network statements use wildcards rather than masks, and mixing them up is a classic configuration error that either blocks everything or permits everything.

Frequently asked questions

Why does a /24 give 254 hosts, not 256?
The first address is the network identifier and the last is the broadcast address. Neither can be assigned to a device, so every ordinary subnet loses exactly two. This is why "I need 256 addresses" always means you need a /23, not a /24.
What is the difference between a subnet mask and a prefix?
Nothing but notation. /24 and 255.255.255.0 describe the same 24-bit boundary. Prefix notation is more compact and is standard in modern documentation and routing; dotted masks persist in Windows configuration dialogs and older equipment.
Can I use 255.0.255.0 as a mask?
No. A valid mask must be a contiguous run of 1 bits followed by 0 bits. Non-contiguous masks were technically possible in very old equipment but are invalid in CIDR and rejected by anything modern. The calculator detects and reports this.
How do I split a /24 into smaller subnets?
Borrow host bits. Each bit borrowed doubles the subnet count and halves the size: a /24 becomes two /25s, four /26s, eight /27s, and so on. Subnet boundaries always fall on multiples of the block size — 256 minus the interesting mask octet.
Does this handle IPv6?
No, this calculator is IPv4 only. IPv6 subnetting follows the same principles with a 128-bit address space, but the address arithmetic exceeds JavaScript's safe integer range and the conventions differ substantially — /64 is the standard subnet size and host counts are astronomically large rather than scarce.
What is the 169.254 address my machine picked up?
APIPA, or link-local addressing. When a host cannot reach a DHCP server it self-assigns from 169.254.0.0/16. Seeing one is a reliable signal that DHCP failed — check the cable, the VLAN, or the DHCP scope before looking anywhere else.

Splitting a network: a VLSM example

Variable-length subnet masking means sizing each subnet to what it actually needs rather than carving everything into equal blocks. Suppose you have 192.168.1.0/24 and four requirements: 100 hosts, 50 hosts, 20 hosts and a point-to-point link.

The method is always the same — allocate largest first, so smaller blocks fit into the gaps rather than fragmenting the space.

NeedSmallest fitSubnetUsable rangeHosts
100 hosts/25 (126)192.168.1.0/25.1 – .126126
50 hosts/26 (62)192.168.1.128/26.129 – .19062
20 hosts/27 (30)192.168.1.192/27.193 – .22230
Point-to-point/30 (2)192.168.1.224/30.225 – .2262

That consumes up to .227 and leaves 192.168.1.228 through 192.168.1.255 free for future growth. Had you allocated smallest first, the /25 would no longer have fitted anywhere and the whole plan would have needed redoing.

Paste each of those four networks into the calculator above to confirm the boundaries. The block-size shortcut makes it quick: a /25 has block size 128, a /26 has 64, a /27 has 32 and a /30 has 4, so each subnet starts at the previous one's start plus its block size.

Supernetting and route summarisation

The reverse operation combines adjacent networks into one advertisement. Four contiguous /24s starting on a /22 boundary — 10.1.4.0, 10.1.5.0, 10.1.6.0 and 10.1.7.0 — summarise into 10.1.4.0/22, replacing four routing table entries with one.

Two conditions must hold: the networks must be contiguous, and the block must start on a boundary that is a multiple of its own size. 10.1.5.0 through 10.1.8.0 cannot summarise into a /22 despite being four consecutive /24s, because 5 is not a multiple of 4. This is why address plans that allocate on power-of-two boundaries from the start stay summarisable, and improvised ones do not.

Related tools