Luminesca Tools
All Tools / Developer

Developer / TOOLKIT

Subnet Calculator

Last updated:

Network address, broadcast, host range and mask for any IPv4 / CIDR.

Free to use · No account needed

Tip: paste a full CIDR like 192.168.1.5/24 into the IP field - the prefix fills automatically.

Results

How to use

  1. Enter an IP address and CIDR prefix, or paste a full CIDR like 10.0.0.0/8.
  2. Network, broadcast, usable range and mask update instantly.
  3. Toggle the "Show binary" checkbox to see the bit-level layout.

Calculate IP subnet details - network address, broadcast, usable hosts, CIDR notation and subnet masks. Essential for network engineers and sysadmins planning or debugging networks.

Use cases

1. Use case: Plan a network Given an IP and /24 or /28, see the network, broadcast and usable host range for configuring routers.

2. Use case: Write firewall rules Determine the exact host range of a subnet so you can scope allow-list rules correctly.

Practical tips

CIDR notation is the input language: /24 means 256 addresses, of which 2 are reserved (network and broadcast), leaving 254 usable hosts. Remember the reserved pair — sizing a subnet for exactly 256 devices means you need a /23. Plan variable-length subnets largest-first; carving a big block into small pieces first strands the space you need later. The calculator shows network, broadcast, first and last usable hosts for every prefix you enter. Like every tool on this site, the Subnet Calculator runs entirely in your browser: the data you enter never leaves your device, nothing is uploaded to a server, and the tool keeps working if your connection drops.

Common mistakes

Subnet sizing has two classic traps, both arithmetic:

  • Forgetting the two reserved addresses per subnet (network and broadcast): a /24 offers 254 usable hosts, not 256.
  • Sizing for exactly the current device count with no growth headroom, which forces a painful re-subnet later.
  • Carving small subnets first and stranding large blocks; plan variable-length allocations largest-first.
  • Reading CIDR as a host count — /24 is a prefix length, not 24 hosts.

CIDR notation, in one table

A CIDR suffix says how many of the 32 bits are the network part. The rest are host bits, and the number of addresses is simply 2 raised to that count. Two addresses in every block are spoken for — the all-zeros address names the network and the all-ones address is the broadcast — which is why a /24 holds 256 addresses but only 254 you can assign. The /31 and /32 rows are the documented exceptions.

Prefix Subnet mask Addresses Usable hosts Note
/16255.255.0.065,53665,534network + broadcast reserved
/20255.255.240.04,0964,094network + broadcast reserved
/22255.255.252.01,0241,022network + broadcast reserved
/24255.255.255.0256254network + broadcast reserved
/25255.255.255.128128126network + broadcast reserved
/26255.255.255.1926462network + broadcast reserved
/27255.255.255.2243230network + broadcast reserved
/28255.255.255.2401614network + broadcast reserved
/29255.255.255.24886network + broadcast reserved
/30255.255.255.25242network + broadcast reserved
/31255.255.255.25422point-to-point link (RFC 3021)
/32255.255.255.25511single host route

Blocks that are not powers of two on the last octet are where most manual arithmetic goes wrong: a /26 is 64 addresses, not 26, and it splits a /24 into exactly four equal parts. Reading the mask column right-to-left is the quickest sanity check — 255 means those bits are fixed, 0 means they are free.

Frequently asked questions

Does the Subnet Calculator send my data anywhere?

No. It runs entirely in your browser — your input is processed on your device and never uploaded. Refresh the page and it still works offline.

How many usable hosts does a /26 have?
A /26 leaves 6 host bits: 64 addresses, of which the first (network) and last (broadcast) are reserved — 62 usable hosts. The minus-two rule prevents most sizing mistakes once it is second nature.
What is the difference between the network address and the broadcast address?
The network address (all host bits zero) identifies the subnet itself and cannot be assigned to a device. The broadcast address (all host bits one) reaches every device in the subnet at once. Both are reserved, which is why usable hosts are always two fewer than the total.
How do I use the subnet calculator?
Enter an IP address and a CIDR prefix (e.g. 192.168.1.5/24), or paste a full CIDR and let the prefix auto-fill. All results update instantly.
What is CIDR notation?
CIDR writes the subnet size as /prefix, e.g. /24 means the first 24 bits are the network part, leaving 8 bits for hosts (254 usable addresses).
Why are usable hosts = total - 2?
In every IPv4 subnet the first address is the network address and the last is the broadcast address - neither can be assigned to a host. /24 therefore has 256-2 = 254 usable addresses.

What does the /24 in 192.168.1.0/24 actually mean?

It means the first 24 bits — 192.168.1 — are fixed and the last 8 bits are yours, so the block holds 2^8 = 256 addresses, of which 254 are assignable after the network and broadcast addresses. The mask is 255.255.255.0.

Which address ranges are reserved for private networks?

RFC 1918 sets aside three: 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. They are not routable on the public internet, which is why home and office networks reuse them freely. Link-local 169.254.0.0/16 and loopback 127.0.0.0/8 are reserved for other purposes.

How do I work out the network and broadcast address by hand?

Convert the IP and the mask to binary, AND them together for the network address, then set every host bit to 1 for the broadcast. The calculator above does both and lists the usable range, which is the faster route when you are checking a real subnet.