RunTheTests
/

IP Subnet Calculator

Address plus mask into network, broadcast, usable range and host count.

What you provide

Any address in the block. A pasted 10.0.0.0/8 works too.

Prefix length or dotted-quad mask — either is accepted.

Result

192.168.1.0/24 — 254 usable hosts

192.168.1.10 is a host inside this block, not the block itself. The subnet starts at 192.168.1.0 and ends at 192.168.1.255, with the first and last reserved for the network and broadcast addresses.

32 bits, split at /24

Address

11000000101010000000000100001010

192.168.1.10

Mask

11111111111111111111111100000000

255.255.255.0 — /24

Network

11000000101010000000000100000000

192.168.1.0/24

  • Network — 24 bits, fixed
  • Host — 8 bits, free to vary
Diagnostic telemetry
Network address
192.168.1.0/24
Subnet mask
255.255.255.0
Wildcard maskThe inverse — what ACLs and OSPF take
0.0.0.255
Broadcast address
192.168.1.255
Usable host range
192.168.1.1 – 192.168.1.254
Usable hosts
254
Total addresses
256
Scope
Private (RFC 1918)
Historic classClassful addressing ended in 1993 — shown because exams still ask
C
Splits into /25
2 subnets of 126 hosts

What this cannot tell you

  • Pure arithmetic on the address and mask you enter. It does not query any network, so it cannot tell you whether the block is in use, routable, or reachable.
  • IPv4 only. IPv6 subnetting works on nibble boundaries and a 128-bit address space, and squeezing it into this form would produce wrong answers.
  • Reports the usable range as the standard defines it. Some equipment can be configured to use the network or broadcast address anyway, and some networks reserve extra addresses for gateways and DHCP by local convention.
  • Non-contiguous masks such as 255.0.255.0 are rejected rather than converted. They are legal in the original specification, no modern stack accepts one, and the nearest prefix would describe a different subnet.

Take this with you

How this calculation works

The mask is turned into a 32-bit pattern of ones followed by zeros, and the address is combined with it: the ones select the network part and the zeros the host part. Everything else follows — the network address is the lowest address in the block, the broadcast is the highest, and the usable range is what lies between. All arithmetic is done in unsigned 32-bit space, which matters more than it sounds: JavaScript bitwise operators are signed, and without correcting for that every block above 127.255.255.255 comes back negative. Enter the mask however you have it — 24, /24 or 255.255.255.0 all work, and an address pasted complete with its prefix is accepted as-is.

What the results mean

Network address
The lowest address in the block, and its identity in a routing table. Not assignable to a host on any normal network.
Broadcast address
The highest address in the block, which reaches every host on it at once. Also not assignable. A /31 and a /32 have neither.
Usable hosts
Total addresses minus the network and broadcast, which is why a /24 gives 254 rather than 256. The exception is /31 and /32 — see the FAQ, because most calculators get it wrong.
Wildcard mask
The bitwise inverse of the subnet mask. Cisco access lists and OSPF network statements take this form rather than the mask.
Scope
Whether the block is private (RFC 1918), loopback, link-local, carrier-grade NAT or public. Private ranges are usable inside your network but are not routed on the internet.

Common problems and fixes

The network address is not the address I typed
That means you entered a host inside the block rather than the block itself, which is normal — the result shows where the subnet actually starts and ends.
My mask is rejected
A valid mask is an unbroken run of ones followed by zeros: 255.255.255.0, not 255.0.255.0. If you have a prefix length instead, type just the number.
I need more hosts than the block allows
Each step down in prefix length doubles the address space: a /24 gives 254 usable, a /23 gives 510, a /22 gives 1022. Check the neighbouring block is free before widening.
Two subnets overlap and I cannot see why
Calculate both and compare their network and broadcast addresses. If either block's range contains the other's network address, they overlap regardless of how different the addresses look.

Frequently asked questions

How many usable hosts are in a /24?

A /24 holds 256 addresses and 254 usable ones. The first is the network address and the last is the broadcast address, and neither can be assigned to a host, so the usable range on 192.168.1.0/24 runs from 192.168.1.1 to 192.168.1.254.

Why does a /31 have two usable addresses and not zero?

Because RFC 3021 says so. On a point-to-point link there are exactly two ends, so there is nothing for a broadcast address to do — anything one end sends reaches the other by definition. Both addresses are therefore assignable. Calculators that blindly subtract two report 0 usable hosts on a /31, which would make a widely deployed configuration impossible. A /32 is the related case: a single host route, with its one address usable.

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

They are bitwise inverses. A subnet mask marks the network bits with ones (255.255.255.0); a wildcard mask marks the bits that are allowed to vary (0.0.0.255). Cisco access lists and OSPF network statements take the wildcard form, which is why entering a subnet mask in an ACL matches the wrong traffic — usually silently.

How do I subnet a network into smaller pieces?

Every extra bit of prefix halves the block. A /24 splits into two /25s, four /26s or eight /27s, and the calculator shows the immediate split above. Work from the largest requirement down: allocate the biggest subnet first, then the next, so you do not leave unusable gaps between them.

Put this on your own site

Free to embed, no attribution required beyond the source link the frame carries itself. It runs entirely in your visitor's browser, sets no cookies and loads no third-party script.

Embed code
<iframe src="https://runthetests.com/embed/subnet-calculator/" width="100%" height="560" style="border:1px solid #e5e5e5;border-radius:8px" title="IP Subnet Calculator" loading="lazy"></iframe>

Preview it at https://runthetests.com/embed/subnet-calculator/. Embedded pages are marked noindex, so yours stays the canonical copy — not this one.

More in NetMath