Subnet Calculator (IPv4 / CIDR)
Parse an IPv4 CIDR into network address, broadcast, netmask, wildcard, host range, and class. Shows binary breakdown and private/public status.
Network
192.168.1.0/24
Netmask
255.255.255.0
Broadcast
192.168.1.255
Wildcard
0.0.0.255
First host
192.168.1.1
Last host
192.168.1.254
Usable hosts
254
CIDR
/24 (24 net bits, 8 host bits)
Class
C
Range
Private / reserved
Binary
All math is 32-bit unsigned. Default CIDR is /32 if you only enter an address. RFC 1918 ranges and loopback are flagged.
How to use
- Enter an IPv4 address with optional CIDR (e.g. 10.0.5.42/16, or 8.8.8.8 for /32).
- Read the network address, broadcast, and usable host range.
- Check whether the IP is in a private range before exposing it externally.
About this tool
ShowHide
Give it an IPv4 address with CIDR (like 192.168.1.0/24) and it returns the network address, broadcast, netmask, wildcard mask, first/last usable host, host count, and IP class. Also detects RFC 1918 private ranges (10/8, 172.16/12, 192.168/16), loopback (127/8), and link-local (169.254/16). Includes a binary view so you can see how the mask aligns. Handles /31 (point-to-point) and /32 (single host) edge cases correctly.
The usable host count is two fewer than the address count because the first and last are reserved: the all-zeros host identifies the network itself and the all-ones host is the broadcast. That is why a /24 offers 254 addresses rather than 256, and why the arithmetic bites hardest at the small end — a /30 has four addresses and exactly two usable, which is the classic four-address block for a router link.
The two exceptions are the ones worth knowing. RFC 3021 lets a /31 carry two usable hosts on a point-to-point link, where broadcast has no meaning, so the usual subtraction would leave zero and the rule is suspended. A /32 is a single address with no network or broadcast at all, used for loopback interfaces and host routes. A calculator that applies the minus two blindly reports nonsense for both.
The binary view is there because masks are easier to see than to reason about. A prefix length is a count of leading ones, so a /26 mask is 11111111.11111111.11111111.11000000 and the boundary sits mid-octet at 192. That is where subnetting stops being decimal arithmetic and starts being bit alignment, and it is why /25, /26 and /27 boundaries land on 128, 64 and 32 rather than anywhere round.
Address classes are shown for reference and have not governed routing since CIDR arrived in 1993. A modern network is defined by its prefix length, and the class of an address tells you nothing about how it is actually routed.
Frequently asked questions
Why are first/last host different from network/broadcast?
In a regular /N subnet, the lowest address is the network ID and the highest is the broadcast — both are reserved. Usable hosts run from network+1 to broadcast−1. /31 and /32 are exceptions (RFC 3021).
What's the wildcard mask for?
It's the bitwise NOT of the netmask, used by Cisco ACLs. 255.255.255.0 ↔ 0.0.0.255. ACL rules like 'permit 192.168.1.0 0.0.0.255' match the same range as a /24 subnet.
Does it work for IPv6?
No, IPv4 only. IPv6 has very different semantics — 128-bit addresses, no broadcast (uses multicast), no traditional 'classes', and prefixes commonly /48, /56, /64. A separate tool is needed.
Why does 10.0.0.0/8 show ~16M hosts?
2^(32−8) − 2 = 16 777 214 usable hosts. The /8 means 8 network bits + 24 host bits. Real networks subdivide this — nobody routes a flat /8 in practice.
Guides on this topic
Related tools
IP Range Expander
Expand a CIDR block (10.0.0.0/24) into a list of IPs, or convert a start-end range into the smallest covering CIDR set.
Network
CIDR Aggregator (Merge & Summarize IP Ranges)
Coalesce a messy list of IPv4/IPv6 addresses, CIDR blocks, and ranges into the smallest equivalent set of CIDR prefixes.
Network
IPv4 Address Converter
Convert an IPv4 address between dotted-decimal, 32-bit integer, hex and binary — and see whether it's private, public, loopback and more.
Network
IP Address Inspector
Type an IPv4 or IPv6 address and see its class, scope (private / public / loopback / link-local), decimal value, binary, reverse-DNS notation, and /32 CIDR.
Network
Random IP & MAC Generator
Generate batches of random IPv4, IPv6, or MAC addresses for tests and mocks — public / private / ULA / link-local / UAA / LAA scopes supported.
Random
MTU and TCP MSS Calculator
Work out the TCP MSS and maximum UDP payload for a given MTU, with the overhead of PPPoE, GRE, WireGuard, VXLAN and other tunnels subtracted.
Network