CIDR subnet calculator

Type an address with a prefix, such as 192.168.1.0/24, and the calculator returns the mask, the wildcard, the network address, the broadcast, the first and last usable host, the total number of addresses and the reverse DNS zone for that block. It also splits a network into smaller prefixes and tells you how many subnets came out of it.

The arithmetic runs on the prefix, not on the mask written out in full. That matters because a mask is only the visual form of the set bits: /23 is 255.255.254.0, and a mask with a bit lost in the middle — 255.255.253.0, for instance — is not a prefix at all, so the page says so instead of rounding to the nearest number.

What you see on screen is the view from the machine that typed it. The tool applies the addressing rules and the ranges reserved by the RFCs, but it does not know whether that block is yours, whether it is already in use, or whether your router agrees. Before you create a new address, check your addressing plan: two sites quietly using the same /24 is a problem no calculator solves.

Everything runs in your browser. The address you type is never sent to a server, nothing is stored when you close the page, and the calculator keeps working if the connection drops after the page has loaded.

How to use

  1. Write the prefix in the field: it accepts CIDR form (10.0.0.0/8), a mask separated by a space (10.0.0.0 255.0.0.0), and a bare address, which is treated as a /32 host.
  2. Read the first and last host rows. Those are the bounds you give to DHCP, and they are what changes when the prefix grows — the network and broadcast addresses stay outside that range on purpose.
  3. To cut the network, type the new prefix in the “Split into” field. The screen reports how many subnets exist and shows a sample of the first ones; the ceiling is 2048 networks, above which the list would not fit on the page.
  4. Check the reverse DNS row before you ask your provider to delegate a zone: with a prefix that is a multiple of 8 the zone is the reversed whole octets, and otherwise RFC 2317 writes the boundary octet and the prefix, as in 64/10.100.in-addr.arpa.

How to split a network without mental arithmetic

The rule is borrowed bits: to split a network into smaller prefixes you borrow bits from the host part. Each borrowed bit doubles the number of networks and halves the block, so `2^(new-current)` is how many subnets are born and `2^(32-new)` is how many addresses each one holds. A /24 split into /26 borrows 2 bits: 4 networks of 64 addresses.

A /24 has 256 addresses but only 254 usable ones, because both ends of the range have a job: the first address names the network and the last one is local broadcast. No host is given either of them, which is why a 255.255.255.0 mask never carried 256 machines, however the powers of two suggest it.

Two prefixes break that minus-2 rule. A /32 is a single host: the two reserved ends do not exist separately, so the count is 1 usable address, and that is how you write the address of an interface or a service loopback. A /31 is the RFC 3021 point-to-point link: two addresses, both usable, no network and no broadcast, because a link with exactly two ends has nobody to broadcast to.

The private ranges are always the same three: 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16, from RFC 1918. The upper bounds matter more than the starts — 172.16.0.0/12 ends at 172.31.255.255, so 172.32.0.0 is already public; and 100.64.0.0/10, which many people mistake for private space, is RFC 6598 CGNAT, not routable on the internet but not yours either.

The table below holds the numbers the library itself returns for the most common prefixes, re-checked on every run of this site’s test suite:

PrefixUsable addressesWhere it shows up
10.0.0.0/816,777,214RFC 1918 — the large private network, one single /8
172.16.0.0/121,048,574RFC 1918 — runs up to 172.31.255.255
192.168.0.0/1665,534RFC 1918 — the range most home routers use
192.168.1.0/24254the subnet you most likely have at home
100.64.0.0/104,194,302RFC 6598 (CGNAT) — shared by your provider
169.254.0.0/1665,534RFC 3927 (link-local) — the address you get without DHCP

Frequently asked

What is CGNAT and why does it show up in my IP?
CGNAT is the address sharing a provider uses when it has no more IPv4 for everyone: many homes leave through one public address, and the provider maps ports downwards. It shows up as 100.64.0.0/10, the RFC 6598 range. The practical effect is that you cannot expose a service from home without asking the provider for a fixed address, because the router on the other side does not know which customer to send the connection to.
What is the difference between a mask and a prefix?
They are the same information written two ways. The prefix counts how many contiguous set bits sit at the start of the address; the mask shows those bits in dotted decimal. /26 and 255.255.255.192 are the same thing, and the calculator accepts both forms, but it refuses a mask with a stray bit, because that corresponds to no prefix at all.
Why does /31 not subtract network and broadcast?
Because RFC 3021 defines the /31 exactly for a direct link between two routers: with two ends and no other participant, the network and broadcast addresses have no job, so both become hosts. That is why the calculator shows 2 usable addresses on a /31 and 1 on a /32, instead of 0 on both.
The site rejected 010.1.1.1 as an invalid address. Why?
Because a leading zero in an octet is ambiguous: many tools read “010” as octal and mean 8, others read it as decimal and mean 10. The calculator will not pick one for you — it asks for the address without the zero. Write 10.1.1.1 and the same prefix resolves normally.
Does the calculator handle IPv6?
No. This page covers IPv4 in CIDR only: 32 bits, arithmetic that fits in a number, and reverse DNS under in-addr.arpa. IPv6 has 128 bits, needs arbitrary-precision arithmetic and has a different delegation structure (ip6.arpa), so it deserves its own tool rather than wrong answers inside this one.

Related tools