Orpheus

CIDR and Subnet Calculator

Network, broadcast, usable range and host count.

Options
Show the mask in binary
Result

Everything is processed in this tab. Nothing you paste is sent anywhere.

Every tool runs entirely in your browser. Your files are never uploaded to a server.

A CIDR prefix says how many leading bits are the network. In 192.168.1.0/24 the first 24 bits are fixed, leaving 256 addresses — 254 usable, since the first is the network and the last is broadcast.

How to use Subnet Calculator

  1. Paste your CIDR blocks. One per line. A host address inside the block works too.
  2. Read the derived values. Network, netmask, wildcard, broadcast, usable range and counts.

About calculating a subnet

CIDR notation replaced the old class-based address system and is a good deal simpler than what it replaced: the number after the slash is how many leading bits identify the network, and everything remaining identifies a host within it. A /24 fixes 24 bits and leaves 8, giving 256 addresses. Each bit given back to the host portion doubles the block. Two conventions cause most of the arithmetic errors. The first is the two reserved addresses — the lowest in a block names the network and the highest is the broadcast address — which is why a /24 offers 254 usable hosts rather than 256. The second is that this convention does not apply at the very small end. RFC 3021 defines /31 blocks for point-to-point links, where both addresses are assignable because a link between exactly two devices has no use for a broadcast address, and a /32 is a single host. A calculator that subtracts two unconditionally reports zero or minus one usable hosts for these, which is a common and visible bug. There is also an implementation trap specific to JavaScript worth knowing if you ever write this yourself. Bitwise operators coerce to signed 32-bit integers, so any address in the upper half of the space — anything from 128.0.0.0 up — comes out negative, and every value derived from it is wrong. The unsigned right shift by zero is what forces the result back into the unsigned range, and it has to be applied to each intermediate value rather than only at the end.

Frequently asked questions

Why are there two fewer usable hosts than addresses?
The first address in a block identifies the network itself and the last is the broadcast address, so neither can be assigned to a host. A /24 has 256 addresses and 254 usable ones.
Does that apply to a /31?
No. RFC 3021 defines /31 for point-to-point links, where both addresses are usable because a two-host link has no need for a broadcast address. A /32 is a single host for the same reason. Calculators that blindly subtract two report zero or negative hosts here.
What is a wildcard mask?
The bitwise inverse of the netmask — 0.0.0.255 where the netmask is 255.255.255.0. Cisco access control lists and OSPF configuration use it instead of the netmask, which is the main reason to want it.
How do I choose a prefix length?
Count the hosts you need, add the two reserved addresses, and round up to the next power of two. Twenty hosts needs 22 addresses, so a /27 with 32. Leaving headroom is cheap in private address space and renumbering later is not.
Which ranges are private?
10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16, defined by RFC 1918. They are not routable on the public internet, which is why they can be reused inside every network without conflict — and why two networks using the same range cannot easily be joined.

Last updated