Skip to content
ZeroServer.tools

IP Subnet Calculator

Calculate subnet details from CIDR or dotted-mask notation.

Presets & Shortcuts

/24 — Class C

Network address192.168.1.0
Subnet mask255.255.255.0
Broadcast address192.168.1.255
First usable host192.168.1.1
Last usable host192.168.1.254
Usable hosts254
Total addresses256
Wildcard mask0.0.0.255
IP typePublic (globally routable)
IP class rangeC: 192.0.0.0–223.255.255.255
Network (hex)0xC0A80100
Broadcast (hex)0xC0A801FF
Subnet mask (hex)0xFFFFFF00
Reverse DNS zone1.168.192.in-addr.arpa

Net: 11000000.10101000.00000001.00000000

Mask: 11111111.11111111.11111111.00000000

Network 192.168.1.0/24, mask 255.255.255.0, 254 hosts

Subnet Layout Grid

Visualizing address space partitions for /24 (256 total IPs)

192.168.1.0/26
Range:192.168.1.1 – 192.168.1.62
Hosts:62
Broadcast:192.168.1.63
192.168.1.64/26
Range:192.168.1.65 – 192.168.1.126
Hosts:62
Broadcast:192.168.1.127
192.168.1.128/26
Range:192.168.1.129 – 192.168.1.190
Hosts:62
Broadcast:192.168.1.191
192.168.1.192/26
Range:192.168.1.193 – 192.168.1.254
Hosts:62
Broadcast:192.168.1.255

How subnet calculation works

CIDR (Classless Inter-Domain Routing) notation expresses an IP range as an IP address plus a prefix length — e.g. 192.168.1.0/24. The prefix (/24) is the subnet mask in bits: /24 = 255.255.255.0. You can also enter the mask in dotted decimal: 192.168.1.0 255.255.255.0. The calculator derives network address (IP & mask), broadcast (network | ~mask), first/last usable hosts, total host count, hex representations, IP type (private/public/loopback), and the reverse DNS delegation zone. For networking tools, also try Random IP Generator or Common Ports Reference.

Built and maintained by Meet Shah · Last updated

What this tool is used for

  • Working out the network, broadcast and host range for a CIDR block.
  • Checking whether an address falls inside a given subnet.
  • Converting a prefix length to a dotted mask.
  • Planning a split of a block into smaller subnets.
  • Deriving the mask, network and broadcast from a prefix in one pass.

Frequently Asked Questions

What input formats are accepted?
CIDR notation such as `192.168.1.0/24`, or an address and dotted-decimal mask separated by whitespace. A mask is converted to a prefix length by counting leading one-bits and rejected if those bits are not contiguous — `255.255.0.255` is not a valid mask.
Why do /31 and /32 report no wasted addresses?
Because the usual network-and-broadcast pair does not apply. A /32 is a single host route, and RFC 3021 allows a /31 to carry two usable addresses on a point-to-point link where a broadcast address has no meaning. Subtracting two would report zero hosts on both.
Is /0 a valid prefix here?
Yes. It is the default route and the calculator handles it specially, because JavaScript takes shift counts modulo 32 — so `0xffffffff << 32` evaluates to `0xffffffff` rather than 0, and a naive contiguity check rejects the one mask that is entirely zero bits.
What does the address-type field tell me?
Whether the address is loopback, RFC 1918 private space, link-local APIPA, multicast, limited broadcast, or globally routable. It is a quick sanity check that the block you are about to hand out is the kind of block you meant.
How do I read the reverse-DNS zone it shows?
It is the `in-addr.arpa` zone whose boundary matches your prefix — one octet for /8 or shorter, two for /16, three below that. Classless delegation for a prefix that is not on an octet boundary needs the RFC 2317 `CNAME` scheme instead.
Why are classes A, B and C still shown?
Classful addressing was superseded by CIDR in 1993, but the class ranges still appear in exam questions, vendor documentation, and older equipment defaults. The value is informational — the prefix length is what actually determines the network.

Common errors and gotchas

  • Counting the network and broadcast addresses as usable hosts, which for IPv4 they are not.
  • Off-by-one on the prefix, where a /24 and a /25 differ by half the range.
  • Assuming a mask can have gaps, when a valid one is a run of ones then zeros.
  • Treating a /31 or /32 as invalid, when both have defined uses.
  • Applying IPv4 host arithmetic to IPv6, where the conventions differ entirely.

Related Developer Utilities tools

Private & free — this tool runs entirely in your browser.

IndieKitShip your Next.js startup in days.affiliate