Skip to content

IP subnet and CIDR calculator

IPv4 and IPv6 subnetting: mask, wildcard, network, broadcast, host range and count, a binary view, VLSM splits and AWS/Azure/GCP reserved hosts.

  • Runs in your browser
  • Nothing you enter is sent
  • Free, no account
Network
Enter an address with a prefix (192.168.1.0/24) or a dotted mask (192.168.1.0/255.255.255.0).
Usable hosts
254
Network and broadcast excluded
Network
192.168.1.0
/24
Broadcast
192.168.1.255
All host bits set
Total addresses
256
2^8
Full breakdown
CIDR notation192.168.1.0/24
Subnet mask255.255.255.0
Wildcard mask0.0.0.255
Host range192.168.1.1 – 192.168.1.254
Mask in binary11111111.11111111.11111111.00000000
Network in binary11000000.10101000.00000001.00000000
ClassC
ScopePrivate (RFC 1918, 192.168.0.0/16)
Integer range3232235776 – 3232236031
prefix /24
mask      = 11111111.11111111.11111111.00000000  (255.255.255.0)
address   = 11000000.10101000.00000001.00000000  (192.168.1.0)
AND       = 11000000.10101000.00000001.00000000  (192.168.1.0)

hosts = 2^(32 − 24) − 2 = 254
The mask picks out the network bits with a bitwise AND; the wildcard is its complement.
Split this block
Divide the network into equal smaller subnets — the first step of any VLSM plan.

Must be longer than /24.

4 subnets of 64 addresses each.

SubnetFirst hostLast hostBroadcast
192.168.1.0/26192.168.1.1192.168.1.62192.168.1.63
192.168.1.64/26192.168.1.65192.168.1.126192.168.1.127
192.168.1.128/26192.168.1.129192.168.1.190192.168.1.191
192.168.1.192/26192.168.1.193192.168.1.254192.168.1.255
IPv6 prefix
128-bit arithmetic done with BigInt, so a /48 reports its 1,208,925,819,614,629,174,706,176 addresses exactly rather than in floating point.
Compressed2001:db8:85a3::8a2e:370:7334
Expanded2001:0db8:85a3:0000:0000:8a2e:0370:7334
Network2001:db8:85a3::/64
First address2001:db8:85a3::
Last address2001:db8:85a3:0:ffff:ffff:ffff:ffff
Addresses in prefix18,446,744,073,709,551,616
/64 subnets available1

What the prefix actually does

An IPv4 address is 32 bits. The prefix says how many of those bits identify the network; the rest identify a host inside it. A /24 fixes the first 24 bits, leaving 8 host bits and therefore 2⁸ = 256 addresses.

address 192.168.  1. 10  = 11000000 10101000 00000001 00001010
mask    255.255.255.  0  = 11111111 11111111 11111111 00000000
AND ---------------------------------------------------------
network 192.168.  1.  0  = 11000000 10101000 00000001 00000000

Every other figure follows from that AND. The broadcast address is the network with all host bits set; the wildcard mask is the mask inverted; the host range is everything in between.

The reference table

PrefixMaskAddressesUsable hostsCloud usable
/16255.255.0.065,53665,53465,531
/20255.255.240.04,0964,0944,091
/24255.255.255.0256254251
/25255.255.255.128128126123
/26255.255.255.192646259
/27255.255.255.224323027
/28255.255.255.240161411
/30255.255.255.25242—
/31255.255.255.25422 (RFC 3021)—
/32255.255.255.25511 (single host)—

Why the cloud column is different

AWS, Azure and GCP each reserve five addresses in every subnet rather than two. In an AWS VPC subnet 10.0.0.0/24:

  • 10.0.0.0 — network address
  • 10.0.0.1 — the VPC router
  • 10.0.0.2 — DNS resolver
  • 10.0.0.3 — reserved for future use
  • 10.0.0.255 — broadcast address (reserved even though VPCs do not support broadcast)

AWS also refuses subnets smaller than /28, which after reservations leaves eleven usable addresses. Turn on cloud mode above to see the corrected count for your own block.

Planning with VLSM

Variable-length subnet masking means allocating each subnet only as much space as it needs instead of splitting everything evenly. The method:

  1. List every subnet you need with its host count, largest first.
  2. Round each up to the next power of two, remembering to add two for network and broadcast — or five in a cloud VPC.
  3. Allocate the largest from the start of the block, then the next, and so on.
  4. Leave the tail unallocated for growth; expanding later is far easier than renumbering.

The split table above lists every subnet at a chosen prefix, which is the working document for that process.

IPv6 is different in one important way

There is no broadcast address and no host-count arithmetic to worry about, because every LAN gets a /64 regardless of how many devices are on it — that is what SLAAC requires. Site allocations are typically /48, which contains 65,536 of those /64s. The IPv6 panel above uses BigInt throughout, so a /32 reports its 79,228,162,514,264,337,593,543,950,336 addresses exactly rather than as a rounded float.

No lookups, ever

This is arithmetic on the bits you typed. There is no WHOIS, no geolocation and no reverse DNS, because all three require a network call and this site makes none. Everything here works with the network disconnected — including on a plane, which is when subnet planning tends to happen.

Questions

Why does a /24 give 254 usable hosts, not 256?

The first address identifies the network and the last is the broadcast address, so both are unusable. 2⁸ = 256 total, minus 2, is 254.

Why does AWS say my /24 has 251 hosts?

AWS, Azure and GCP each reserve five addresses per subnet: the network address, the router, a DNS resolver, one reserved for future use, and the broadcast address. Turn on cloud mode to see that count.

Is a /31 really usable?

Yes, on point-to-point links. RFC 3021 redefines both addresses in a /31 as host addresses, because a two-node link has no need for a broadcast address. Most router platforms support it.

Does this look up who owns an address?

No, and it never will. WHOIS and geolocation need a network call, which this site does not make. Everything here is arithmetic on the bits you typed.

How do I plan a VLSM split?

Start from the largest subnet you need, take it from the front of the block, then carve the next size out of what remains. The split table on this page lists every subnet at a chosen prefix so you can allocate from it.