Skip to content
Tool Corner

Subnet Calculator & CIDR Visualiser

Most subnet calculators hand you four numbers and leave you to picture the rest. Slide the mask here and watch the block actually split: which bits you borrowed, how many subnets that bought, and exactly where each one starts and ends.

New to this? An IPv4 address is 32 ones and zeros. The prefix — the /24 after the address — says how many of those bits identify the network; the rest identify machines on it. Subnetting means taking a few bits back from the machine half to carve one network into several smaller ones. The mask is the same information written as an address. That is the whole idea; everything below is bookkeeping.

Built and verified by Jogeswar, MSc, PMP — Tool CornerAddress maths checked against the RFCs listed below
Start with a real example
  • Network bits — fixed by the parent block
  • Borrowed bits — what makes the subnets
  • Host bits — addresses inside one subnet
Selected subnet
{{ selTxt }}
{{ note }}
Network
{{ netTxt }}
Broadcast
{{ bcastTxt }}
Usable hosts
{{ usableTxt }}
Usable range
{{ rangeTxt }}
Subnet mask
{{ maskTxt }}
Wildcard mask
{{ wildTxt }}
Subnets around the selection — {{ countTxt }} in total
# Network Usable range Broadcast
{{ row.id }} {{ row.net }} {{ row.range }} {{ row.bcast }}
In plain English

{{ netTxt }} gives you {{ usableTxt }} usable addresses, running from {{ rangeTxt }}. Its mask is {{ maskTxt }}, and it is one of {{ countTxt }} equal subnets carved out of the block above.

What next?

What your result means

An IPv4 address is 32 bits, and a prefix says how many of those bits name the network rather than the machine. Everything left over is host space. The network address is that block with every host bit set to zero, and the broadcast address is the same block with every host bit set to one.

Neither of those two can be given to a machine, which is why usable hosts is always two fewer than the block size. The subnet mask is the same prefix written as four octets, and the wildcard mask is that inverted — the form Cisco access lists and OSPF statements ask for.

Why this one is different

Network and broadcast addresses, the usable range between them, the subnet mask and its wildcard all come from one prefix, and the subnets it divides into are listed as rows you can pick through. The wildcard mask matters because access lists want that form, and working it out by hand is where the mistakes happen.

How it works

Subnetting is borrowing. You take bits from the host part and promote them to network duty, and every bit you borrow doubles the number of networks while halving the size of each one. Borrow four bits from a /16 and you have sixteen /20s; borrow a fifth and you have thirty-two /21s. That trade is the whole of it, and it is why the bit strip at the top of the simulator is the honest picture of what is happening.

The arithmetic is pure bit masking. The mask for a prefix is that many ones followed by zeros; ANDing an address with it clears the host bits and leaves the network address; ORing with the inverted mask sets them all and gives the broadcast. Subnet n of the split starts n block-sizes above the parent, and a block size is two to the power of the remaining host bits. Everything on this page comes out of those four operations, computed in your browser.

How to use this simulator

  1. Type the base address of the block you have been given — it is snapped to its network boundary automatically.
  2. Set the network prefix you actually own, then drag split into to the size you need.
  3. Watch the borrowed bits light up amber in the strip, and the parent bar divide underneath.
  4. Step through the subnets, or click any row in the table, to see that one expanded with its usable range.
  5. Use share calculation to hand someone the exact split — the address, both prefixes and the selected subnet all travel in the link.

Formula

subnet mask: mask = ( 2³² − 2³²⁻ᵖ )
network address: net = address AND mask
broadcast: bcast = net OR ( NOT mask )
block size: size = 2³²⁻ˢ
subnets created: count = 2⁽ˢ⁻ᵖ⁾
nth subnet: netₙ = base + n × size
usable hosts: size − 2
  • p — the prefix of the parent block, the network bits you started with
  • s — the prefix you are splitting to; s minus p is the number of bits borrowed
  • size — total addresses in one subnet, network and broadcast included
  • n — which subnet, counted from zero at the base address

Example calculation

You are handed 10.0.0.0/16 and asked to carve it into /20 networks. What is the third one?

bits borrowed: 20 − 16 = 4 → 2⁴ = 16 subnets
block size: 2³²⁻²⁰ = 4,096 addresses
subnet 3 (n=2): 10.0.0.0 + 2 × 4096 = 10.0.32.0/20
broadcast: 10.0.32.0 + 4096 − 1 = 10.0.47.255
usable range: 10.0.32.1 – 10.0.47.254 (4,094 hosts)
mask / wildcard: 255.255.240.0 / 0.0.15.255

Those are the simulator's starting values and the panel shows exactly these figures. The jump of 32 in the third octet is the giveaway: with four bits borrowed the subnets step in sixteens, so they land on .0, .16, .32, .48 and so on.

Prefix cheat sheet

/24
254 hosts
/26
62 hosts
/30
2 hosts
/31
2, point-to-point

The four prefixes that come up most in practice. A /30 was the traditional choice for a router-to-router link and wastes half its addresses on network and broadcast; RFC 3021 made the /31 legal for that job and this tool counts it as two usable hosts.

Frequently asked questions

Why does a /24 have 254 usable hosts and not 256?

A /24 leaves 8 host bits, which is 256 addresses, but two of them are reserved. The all-zeros host address names the network itself and the all-ones host address is the broadcast address for that network, so neither can be assigned to a machine. That leaves 254. The same subtraction applies at every prefix length from /0 to /30.

What is a wildcard mask for?

It is the subnet mask with every bit inverted, and it is what Cisco access control lists and OSPF network statements expect instead of a mask. A /20 has the mask 255.255.240.0 and the wildcard 0.0.15.255. A zero in a wildcard means the bit must match; a one means the bit is free to be anything.

Can a subnet ever have only two addresses?

Yes. A /31 has exactly two addresses and RFC 3021 allows both to be used as hosts on a point-to-point link, because a link with only two ends has no need of a broadcast address. This calculator follows that rule and reports two usable hosts for a /31. A /32 is a single address, used for loopbacks and host routes.

Related tools

Assumptions & limitations

  • IPv4 only. IPv6 uses the same prefix idea over 128 bits, but none of the host-count arithmetic here transfers, so it is not offered rather than offered wrongly.
  • Fixed-length subnetting. The split divides a block into equal parts. Variable-length subnetting, where different departments get different sizes out of one block, means applying this repeatedly to the leftovers.
  • The split is capped at 4,096 subnets. Twelve borrowed bits is the limit, so that the table and the address bar stay readable rather than trying to render a million rows.
  • No address-type warnings. The tool will happily subnet multicast or reserved space; it does not check your block against the IANA special-purpose registry.
  • Educational and planning use. Check any split against your own hardware and addressing policy before it goes near production.

Further reading

Our guide to subnetting by hand covers the block-size method, the magic-number shortcut and a full VLSM split — the paper skills this visualiser is showing you. For the other place bit-level thinking trips people up, see encoding versus hashing.

Sources & references

The addressing rules, the host-count convention and the /31 exception all come from the primary standards rather than second-hand summaries.

  • RFC 4632 — Classless Inter-Domain Routing, the prefix notation this tool is built on
  • RFC 3021 — using 31-bit prefixes on point-to-point links, the reason a /31 reports two usable hosts
  • RFC 1918 — the private address blocks 10/8, 172.16/12 and 192.168/16 that the examples here use
  • IANA IPv4 Special-Purpose Address Registry — the ranges that are reserved rather than assignable
Last updated
This is a teaching tool, not a network audit

The split shown is the arithmetic of the address space alone. It does not know your routing, your gateway conventions, whether your equipment reserves the network and broadcast addresses, or how your provider has delegated the block. Confirm any plan against your own kit before you configure anything.