Subnet Calculator
Calculate IPv4 and IPv6 subnets online: network and broadcast address, usable host range, subnet mask, wildcard and binary. Split a CIDR block into subnets.
Runs in your browser · Nothing uploaded · No sign-up
Something not working, or missing a feature? Send feedback
About the Subnet Calculator
The Subnet Calculator works out everything about an IPv4 or IPv6 network from an address and a prefix: the network and broadcast addresses, the usable host range, the subnet mask and wildcard mask, and the binary form. It also splits a block into smaller subnets, which helps when you plan VLANs, cloud VPCs or firewall rules.
Everything runs in your browser, so your input is never uploaded to a server.
How to use the Subnet Calculator
- Type an address with a prefix (192.168.1.10/24), with a mask (10.0.0.5 255.255.0.0) or an IPv6 address (2001:db8::1/48).
- Change the mask from the list to compare host counts.
- Read the network, broadcast, host range, masks and address type, and copy any value.
- Use "Split into smaller subnets" to divide the block, for example a /24 into four /26 networks.
IPv4 CIDR cheat sheet
| Prefix | Subnet mask | Addresses | Usable hosts |
|---|---|---|---|
| /8 | 255.0.0.0 | 16,777,216 | 16,777,214 |
| /16 | 255.255.0.0 | 65,536 | 65,534 |
| /20 | 255.255.240.0 | 4,096 | 4,094 |
| /22 | 255.255.252.0 | 1,024 | 1,022 |
| /23 | 255.255.254.0 | 512 | 510 |
| /24 | 255.255.255.0 | 256 | 254 |
| /25 | 255.255.255.128 | 128 | 126 |
| /26 | 255.255.255.192 | 64 | 62 |
| /27 | 255.255.255.224 | 32 | 30 |
| /28 | 255.255.255.240 | 16 | 14 |
| /29 | 255.255.255.248 | 8 | 6 |
| /30 | 255.255.255.252 | 4 | 2 |
| /31 | 255.255.255.254 | 2 | 2 |
| /32 | 255.255.255.255 | 1 | 1 |
/31 and /32 count every address as usable (RFC 3021 point-to-point links and single hosts).
Sources: RFC 4632: CIDR, RFC 1918: private address space, RFC 3021: /31 point-to-point links
Examples
Input
192.168.1.10/24
Result
Network 192.168.1.0 · Broadcast 192.168.1.255 Hosts 192.168.1.1 – 192.168.1.254 (254) Mask 255.255.255.0 · Wildcard 0.0.0.255
Input
172.16.5.4/20
Result
Network 172.16.0.0 · Broadcast 172.16.15.255 Hosts 172.16.0.1 – 172.16.15.254 (4,094) Mask 255.255.240.0
Input
10.1.2.3 255.255.255.252
Result
Network 10.1.2.0/30 · 2 usable hosts (10.1.2.1 – 10.1.2.2)
Input
192.168.10.0/24 → /26
Result
192.168.10.0/26, 192.168.10.64/26, 192.168.10.128/26, 192.168.10.192/26
Common mistakes
- Using the network or broadcast address as a host. In a /24, .0 and .255 cannot be assigned to a device. Start at the first usable host.
- Overlapping subnets. Two VPCs or VLANs with overlapping ranges cannot be routed to each other. Split one larger block into subnets instead of picking ranges by hand.
- Cloud reserved addresses. Cloud providers keep extra addresses in every subnet (AWS reserves 5), so fewer hosts are usable than the plain IPv4 count.
Works well with the Subnet Calculator
- Decimal to Binary Converter: see a single octet as bits.
- Hex to Binary Converter: expand IPv6 groups into bits.
- Chmod Calculator: set file permissions on the server you are configuring.
Frequently asked questions
How many hosts are in a /24?
256 addresses, of which 254 are usable: the first (network address) and the last (broadcast address) are reserved. In general, a /n IPv4 network has 2^(32 − n) addresses and 2 fewer usable hosts.
Why do /31 and /32 have no broadcast address?
A /31 has only two addresses, and RFC 3021 lets point-to-point links use both. A /32 is a single host, used for loopbacks and host routes. The calculator counts 2 and 1 usable hosts for them.
What is a wildcard mask?
The inverse of the subnet mask: 0.0.0.255 for 255.255.255.0. Cisco ACLs and OSPF use wildcard masks, where 1 bits mean "any value".
Which addresses are private?
10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 (RFC 1918) for IPv4, and fc00::/7 (unique local) for IPv6. 100.64.0.0/10 is carrier-grade NAT space. The calculator labels the address type.
Does IPv6 have a broadcast address?
No. IPv6 uses multicast instead, so every address in the range can be assigned. A /64 is the standard size for one LAN segment.
Related tools
Case Converter
Convert text between camelCase, PascalCase, snake_case, kebab-case, CONSTANT_CASE, Title Case and more online. Rename variables and keys in one paste.
Remove Duplicate Lines
Remove duplicate lines from text online, keeping the first occurrence and the original order. Optionally ignore case, extra spaces and empty lines.
Sort Lines
Sort lines of text online alphabetically, naturally (item 2 before item 10), by number or by length, in ascending or descending order. Runs in your browser.
Remove Line Breaks
Remove line breaks from text online: join broken lines from a PDF or email into one paragraph, or into a comma-separated list. Optionally keep paragraph breaks.
Remove Extra Spaces
Remove extra spaces from text online: collapse repeated spaces and tabs, trim every line and squeeze blank lines. Clean pasted text in one click.
Slug Generator
Turn any title into a clean URL slug online: lowercase, accents removed, symbols dropped, words joined with hyphens or underscores. One slug per line.