Subnet calculator
Enter an IP address and a prefix or netmask to get its network, broadcast address, usable host range and netmask. IPv6 works too.
Subnet
192.0.2.0/24Example: type your own address above.
- Address
- 192.0.2.10
- Network
- 192.0.2.0/24
- Prefix length
- /24
- Wildcard mask
- 0.0.0.255
- All addresses
- 192.0.2.0 – 192.0.2.255
- Class (historical)
- C
- Type
- Documentation (RFC 5737), not routed
- Hex
- 0xC000020A
- Integer
- 3221225994
192.0.2.10 is a host inside the network 192.0.2.0/24.
In binary
network bits in bold, host bits in grey
- Address
- 11000000.00000000.00000010.00001010
- Netmask
- 11111111.11111111.11111111.00000000
- Network
- 11000000.00000000.00000010.00000000
- Broadcast
- 11000000.00000000.00000010.11111111
How it works
An IP address has two parts. The first bits name the network, and the rest name one device (a host) on it. The prefix length says where the split is: in 192.0.2.10/24, the first 24 bits are the network 192.0.2.0. The netmask 255.255.255.0 says the same thing in dotted form.
On an IPv4 network, the first address names the network and the last is the broadcast address (it reaches every host at once). Hosts get the addresses in between, so a /24 has 256 addresses and 254 usable hosts. Two exceptions come from RFC 3021: a /31 has no broadcast, so both its addresses work on a link between two routers, and a /32 is a single host.
IPv6 has no broadcast, so every address in a prefix is usable. A LAN is almost always a /64, because SLAAC (how devices give themselves an address) needs 64 host bits. A prefix that's a multiple of 4, like /48 or /56, ends on a hex digit, which keeps it readable and makes reverse DNS zones simple.
To cut a block into equal pieces, use the subnet splitter. For pieces of different sizes, use the VLSM calculator. The subnet cheat sheet lists every prefix with its netmask and size.