Subnet Calculator — CIDR, Netmask and Host Range

Enter an address and prefix to get the network, broadcast, host range and mask — then split the block, find its supernet, or check whether an address belongs.

—

What this tool does

Give it an address and a prefix — 192.168.1.10/24 — and it works out everything the pair implies: the network the address belongs to, the broadcast address for that network, the range of addresses you can actually assign, the dotted mask and its wildcard complement, and how many hosts the block holds. It also answers the two follow-up questions that come up constantly: which block does this address fall in, and how do I divide this network into smaller pieces.

The one number that matters

An IPv4 address is 32 bits. The prefix length says how many of them, counted from the left, are fixed as the network — the rest identify the host. That is the whole idea. A /24 fixes 24 bits and leaves 8, which is 2⁸ = 256 addresses. The mask is just that prefix written out: 24 ones followed by 8 zeros, grouped into octets, is 255.255.255.0. Change the prefix and everything else changes with it, which is why the tool takes the prefix and derives the rest rather than asking you for a mask.

Network, broadcast, and why two addresses disappear

Within any block, the address with every host bit set to 0 is the network address — it names the block and is never assigned to a device. The address with every host bit set to 1 is the broadcast address, and a packet sent to it reaches every device on the block at once. Both are reserved, so a block of 2ⁿ addresses has 2ⁿ − 2 usable hosts. For a /24 that is 254. This is the single most common source of off-by-two confusion in addressing, and it is why a network that needs 250 addresses fits in a /24 but one that needs 255 does not.

Prefix reference

PrefixNetmaskWildcardAddressesUsable hosts
/8 255.0.0.0 0.255.255.255 16,777,216 16,777,214
/16 255.255.0.0 0.0.255.255 65,536 65,534
/20 255.255.240.0 0.0.15.255 4,096 4,094
/22 255.255.252.0 0.0.3.255 1,024 1,022
/23 255.255.254.0 0.0.1.255 512 510
/24 255.255.255.0 0.0.0.255 256 254
/25 255.255.255.128 0.0.0.127 128 126
/26 255.255.255.192 0.0.0.63 64 62
/27 255.255.255.224 0.0.0.31 32 30
/28 255.255.255.240 0.0.0.15 16 14
/29 255.255.255.248 0.0.0.7 8 6
/30 255.255.255.252 0.0.0.3 4 2
/31 255.255.255.254 0.0.0.1 2 2
/32 255.255.255.255 0.0.0.0 1 1

Private ranges

Three blocks are reserved for private use by RFC 1918 and are never routed on the public internet, which is why every home router hands out addresses from one of them:

RangeAddressesWhere it is used
10.0.0.0/816,777,216The largest block — one /8 for a whole large private network.
172.16.0.0/121,048,576Sixteen /16s, from 172.16 through 172.31.
192.168.0.0/1665,536The home and small-office default — 256 /24s.

Because they are not routable, the same private address can exist in millions of networks at once without conflict — the router translates at the boundary. This is also why a private address tells you nothing about location, and why two networks using 192.168.1.0/24 cannot talk directly until one of them is renumbered.

Frequently asked questions

What does the /24 in 192.168.1.0/24 mean?

The number after the slash is the prefix length: how many of the address’s 32 bits belong to the network, counted from the left. A /24 leaves 8 bits for hosts, so the block has 2⁸ = 256 addresses. The rest of the address identifies the individual device. Everything else in subnetting — the mask, the range, the broadcast — is derived from that one number.

Why are there 254 usable hosts in a /24 and not 256?

Because two addresses in each block are reserved. The lowest address, where every host bit is 0, names the network itself and is not assigned to a device; the highest, where every host bit is 1, is the broadcast address that reaches all devices at once. 256 − 2 = 254. The exception is /31 and /32, which have no such reservation.

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

They are complements. A subnet mask has 1s where the address is network and 0s where it is host — 255.255.255.0 for a /24. A wildcard mask inverts that: 0s where the network is fixed and 1s where any value is allowed — 0.0.0.255 for the same /24. Cisco access lists and OSPF statements use the wildcard form, which is why the same network is written both ways depending on where you are.

Why does splitting into 3 subnets give me 4?

Because subnetting works in powers of two. To make 3 subnets you borrow 2 bits from the host part (2² = 4) — one bit would give only 2. You cannot borrow 1.58 bits, so a request for 3 always yields 4, and the tool shows you what it actually produced rather than the number you asked for. The same applies to any count that is not a power of two.

When is a /31 used?

On point-to-point links between two routers. RFC 3021 allows a /31 to use both its addresses as hosts, since there is no need to reserve a network or broadcast address when only two devices will ever be on the link. It doubles the number of usable point-to-point links you can fit in a block, which is worth knowing when addressing fast — a /30 wastes half its addresses on every hop.

Is my address sent anywhere?

No. The arithmetic is done in your browser on the text you type. No address is resolved, pinged, looked up in a whois database or sent to a server.

How do I check whether two addresses are on the same subnet?

Apply the same mask to both and compare the resulting network addresses. 192.168.1.10/24 and 192.168.1.200/24 both mask to 192.168.1.0, so they are on the same network; 192.168.2.10 masks to 192.168.2.0 and is on a different one. The membership test on this page does that comparison for you, including the case where the two addresses are given different prefix lengths.

What is a supernet?

A supernet is the larger block one or more prefix bits shorter that contains a given network. 192.168.1.0/24 is contained in 192.168.0.0/23, which is contained in 192.168.0.0/22. Supernetting is how routes are summarised: a router can advertise one /22 instead of four separate /24s, provided the four are contiguous and aligned. The calculator shows the immediate supernet, which is the smallest block that contains the network and is one bit shorter.

Which IPv4 ranges are private or special?

The private ranges are 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 (RFC 1918). 127.0.0.0/8 is loopback, 169.254.0.0/16 is link-local (the range a device picks when DHCP fails), 100.64.0.0/10 is carrier-grade NAT, and 0.0.0.0/8 and 224.0.0.0/4 are “this network” and multicast. None of these is routable on the public internet, so an address in one of them tells you something about where it can live.

Sources

  • RFC 1918 — Address Allocation for Private Internets.
  • RFC 3021 — Using 31-Bit Prefixes on IPv4 Point-to-Point Links.
  • RFC 4632 — Classless Inter-domain Routing (CIDR): the Internet Address Assignment and Aggregation Plan.

Everything runs in your browser — nothing you type is uploaded.