Free · No sign-up · Runs offline in your browser

Subnet Calculator

Enter any IPv4 address and prefix to get the network address, broadcast, usable host range, subnet mask, wildcard mask and binary breakdown. Then split the block into smaller subnets, or work backwards from the number of hosts you actually need.

  • ✓ CIDR and dotted mask
  • ✓ Binary view
  • ✓ Subnet splitting
  • ✓ Hosts → prefix
  • ✓ RFC 1918 detection

Network

Jump to a common block

Split into smaller subnets

Size a subnet by hosts needed

Everything is computed locally in your browser using 32-bit integer maths. No address you type is sent anywhere, which matters when the subnet you are planning is real infrastructure.

What CIDR notation actually says

An address like 192.168.1.0/24 is two statements joined together. The first 24 bits identify the network, so every device on it shares 192.168.1. The remaining 8 bits identify the host, giving 256 addresses of which 254 can be assigned. Change the prefix and you are simply moving the boundary between those two halves.

Total addresses2 ^ (32 − prefix)
Usable hostsNetwork and broadcast are reserved.
2 ^ (32 − prefix) − 2
Network addressIP AND mask
Broadcast addressnetwork OR NOT mask
Wildcard maskUsed in ACLs and OSPF.
255.255.255.255 − mask
Subnets when you split2 ^ (new prefix − old prefix)

Why this beats the usual subnet page

▣

Binary you can actually read

The address is shown in binary with the network bits highlighted, so the prefix boundary stops being abstract. This is the part that makes subnetting click.

✂

Splits the block for you

Pick a longer prefix and get the resulting child subnets listed with their network, broadcast and usable range — not just a count.

⇆

Works backwards from hosts

Enter the number of devices you need to support and get the smallest prefix that fits. That is the direction real network planning runs in.

🔒

Nothing leaves your browser

Pure client-side integer maths. No request is made with the address you type, which matters when you are planning production infrastructure.

🏷

Flags the special ranges

RFC 1918 private space, loopback, link-local and carrier-grade NAT are identified automatically instead of leaving you to remember the boundaries.

⚡

Handles the edge cases

/31 point-to-point links under RFC 3021 and /32 host routes are calculated correctly rather than returning a nonsensical negative host count.

How to use the subnet calculator

  1. Enter an address and prefix

    Any address inside the block works — type 192.168.1.77/24 and it resolves to the 192.168.1.0 network. You do not need to know the network address in advance.

  2. Read the range

    The usable host range is what you can hand out via DHCP or assign statically. The network and broadcast addresses sitting either side of it are not assignable.

  3. Split if you need to

    Choose a longer prefix to carve the block into equal children. A /24 split at /26 gives four subnets of 62 usable hosts each.

  4. Or size from demand

    Enter how many hosts a segment needs and take the prefix it returns. Leave headroom — a /26 sized exactly to 62 devices has nowhere to grow.

CIDR to subnet mask chart

Every IPv4 prefix with its dotted mask, total addresses and assignable hosts.

CIDRSubnet maskAddressesUsable hostsTypical use
/8255.0.0.016,777,21616,777,214Legacy class A, 10.0.0.0/8
/12255.240.0.01,048,5761,048,574172.16.0.0/12 private space
/16255.255.0.065,53665,534Large campus, 192.168.0.0/16
/20255.255.240.04,0964,094Large VPC or site block
/21255.255.248.02,0482,046Site aggregation
/22255.255.252.01,0241,022Four contiguous /24s
/23255.255.254.0512510Large office floor
/24255.255.255.0256254The standard LAN segment
/25255.255.255.128128126Half a /24, VLAN split
/26255.255.255.1926462Department or VLAN
/27255.255.255.2243230Small office, DMZ
/28255.255.255.2401614Server rack, small DMZ
/29255.255.255.24886Small block from an ISP
/30255.255.255.25242Classic point-to-point link
/31255.255.255.25422Point-to-point, RFC 3021
/32255.255.255.25511Single host or loopback

Reserved and private IPv4 ranges

Ranges that are not routable on the public internet, or are set aside for a specific purpose.

RangePrefixAddressesPurpose
10.0.0.0/816,777,216Private network, RFC 1918
172.16.0.0/121,048,576Private network, RFC 1918
192.168.0.0/1665,536Private network, RFC 1918
100.64.0.0/104,194,304Carrier-grade NAT, RFC 6598
127.0.0.0/816,777,216Loopback
169.254.0.0/1665,536Link-local, APIPA
224.0.0.0/4268,435,456Multicast, class D
240.0.0.0/4268,435,456Reserved, class E

Planning habits worth keeping

  • ✓Leave room to grow. Sizing a segment to exactly the device count you have today guarantees a renumbering project later. Take the next prefix up.
  • ✓Align on bit boundaries. Subnets that start on clean boundaries summarise into a single route. Ad hoc ranges bloat routing tables.
  • ✓Avoid 192.168.0.0/24 and 192.168.1.0/24 for VPN sites. Every home router uses them, and overlapping ranges break split tunnels.
  • ✓Reserve the low addresses. Convention puts gateways and infrastructure at the bottom of the range and DHCP pools above them.
  • ✓Use /31 on point-to-point links. A /30 wastes half its addresses on a network and broadcast neither router needs.
  • ✓Document the plan. An IP allocation table costs an hour now and saves days during an incident.

Subnetting FAQs

How many usable hosts are in a /24?

254. A /24 contains 256 total addresses, and two are reserved: the first is the network address and the last is the broadcast address. That leaves 254 that can be assigned to devices. The general formula is 2 to the power of 32 minus the prefix, minus 2.

What is the subnet mask for /26?

255.255.255.192. A /26 uses 26 network bits, leaving 6 host bits for 64 total addresses and 62 usable hosts. Splitting a /24 at /26 produces exactly four subnets, ending in .0, .64, .128 and .192.

How do I calculate the network address?

Perform a bitwise AND between the IP address and the subnet mask. For 192.168.1.77 with a /24 mask, the first 24 bits are kept and the last 8 are zeroed, giving 192.168.1.0. The broadcast is the opposite operation: set every host bit to 1, giving 192.168.1.255.

What is a wildcard mask?

The bitwise inverse of the subnet mask, used by Cisco access lists and OSPF network statements. A /24 has a subnet mask of 255.255.255.0 and a wildcard mask of 0.0.0.255. A zero bit means the corresponding address bit must match, a one bit means it is ignored.

Why do you subtract 2 from the host count?

Because the all-zeros host address identifies the network itself and the all-ones address is the directed broadcast for that network. Neither can be assigned to an interface. The exceptions are /31, where RFC 3021 allows both addresses on a point-to-point link, and /32, which describes a single host.

What is the difference between /24 and 255.255.255.0?

Nothing — they are two notations for the same mask. CIDR counts the network bits, and 24 bits set to 1 written in dotted decimal is 255.255.255.0. CIDR is shorter and is what modern routing, cloud consoles and firewall rules use.

How many subnets do I get if I split a /16 into /24s?

256. The formula is 2 to the power of the difference between the prefixes, and 24 minus 16 is 8, giving 2 to the 8th. Each of those /24s carries 254 usable hosts, so the /16 supports 65,024 hosts once subnetted this way.

Which private IP range should I use?

10.0.0.0/8 gives the most room and is the usual choice for anything that might grow or connect to other networks. 172.16.0.0/12 is a good middle ground and is less commonly used, which reduces the risk of overlap during VPN or acquisition work. 192.168.0.0/16 is fine for home and very small offices but collides with consumer router defaults constantly.

Plan the block before you configure it

Enter an address, read the range, split it where you need to, and copy the numbers straight into your config.

Open the calculator →
Scroll to Top