Subnet Calculator (CIDR)

IPv4 network, broadcast, host range and mask from CIDR.

About this tool

Enter an IPv4 address with a prefix like 10.0.0.0/24, or with a netmask, to get the network and broadcast addresses, usable host range, host count, wildcard mask and binary view. You can also check whether another address belongs to the subnet.

How to use it

  1. Enter an IPv4 address with a prefix, like 192.168.1.10/24, or with a netmask.
  2. Read the network, broadcast, host range, netmask, wildcard and number of usable hosts.
  3. Check whether another address is inside the subnet.
  4. Optionally split the network into smaller subnets with a longer prefix.

Questions

What does /24 mean?
It is the prefix length: the first 24 bits are the network part and the remaining 8 bits number the hosts. A /24 has 256 addresses, of which 254 can be assigned to hosts.
Why are two addresses not usable?
The first address identifies the network and the last is the broadcast address. Point-to-point /31 links (RFC 3021) and single-host /32 routes are the exceptions.
Which ranges are private?
10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 (RFC 1918). 100.64.0.0/10 is used for carrier-grade NAT. These addresses are not routed on the public internet.
What is a wildcard mask?
The inverse of the netmask, used in Cisco ACLs and OSPF. For 255.255.255.0 the wildcard is 0.0.0.255.
What is the difference between a subnet mask and a prefix length?
They carry the same information. The prefix counts the leading 1 bits of the mask, so /24 equals 255.255.255.0 and /20 equals 255.255.240.0. A valid mask has all its 1 bits together on the left, so a value like 255.0.255.0 is rejected.
Does this subnet calculator support IPv6?
No, it handles IPv4 only. IPv6 uses the same CIDR idea with 128-bit addresses, but the numbers work differently: a normal LAN is a /64, there is no broadcast address, and nobody counts usable hosts because a single /64 holds about 18 quintillion addresses.
What does 0.0.0.0/0 mean?
It covers every IPv4 address, because a prefix of 0 fixes no bits at all. In a routing table it is the default route, used when nothing more specific matches. In a firewall or security group rule it means “from anywhere”, so open it only for ports that really are public.

How CIDR notation works

CIDR notation writes a network as an address plus a prefix length, like 192.168.10.0/26. The prefix says how many leading bits of the 32-bit IPv4 address are fixed for the network; the remaining bits number the hosts. A /26 fixes 26 bits and leaves 6, which gives 2⁶ = 64 addresses. Each step of one in the prefix halves or doubles the size of the network.

CIDR replaced the old classful system in 1993 (RFC 1519, now RFC 4632), so a network no longer has to be exactly a class A, B or C block. This subnet calculator still shows the historical class for reference, but routing ignores it. The binary view marks network bits and host bits differently, so you can see exactly where the prefix cuts through the address and which bits are free for hosts.

How to calculate the network and broadcast address

To get the network address, apply a bitwise AND between the IP address and the netmask, which sets every host bit to 0. For 192.168.10.37/26 the netmask is 255.255.255.192, and 37 AND 192 is 0, so the network is 192.168.10.0. The broadcast address sets every host bit to 1 instead, giving 192.168.10.63. The usable host range lies between them, from .1 to .62.

The same math answers “is this IP in that subnet?”: mask both addresses with the prefix and compare. 192.168.10.50 masks to 192.168.10.0, so it is inside; 192.168.10.70 masks to 192.168.10.64, so it is outside. That is what the address check here does. You can enter the network as a CIDR prefix or with a dotted netmask, such as 10.0.0.1 255.255.0.0, and get the same result.

How to split a network into subnets for a VPC

To divide an address block, choose a longer prefix. Each extra bit doubles the number of subnets and halves their size: a /24 splits into two /25s, four /26s or sixteen /28s. The split panel lists every resulting subnet with its host range and broadcast address, up to the first 256. Subnets made this way never overlap, because each starts on a boundary that is a multiple of its size.

When planning a cloud VPC, start bigger than you think you need, such as a /16, and carve out subnets per availability zone and tier. Cloud providers reserve extra addresses: AWS and Azure keep five in every subnet, not two, so a /28 gives 11 usable hosts instead of 14. Avoid ranges that overlap your office network or other VPCs you may peer with, because overlapping CIDRs can’t be routed.

CIDR cheat sheet (IPv4)

Every prefix from /8 to /32 with its netmask and size. A /31 has two usable addresses for point-to-point links (RFC 3021).

CIDRNetmaskWildcard maskTotal addressesUsable hosts
/8255.0.0.00.255.255.25516,777,21616,777,214
/9255.128.0.00.127.255.2558,388,6088,388,606
/10255.192.0.00.63.255.2554,194,3044,194,302
/11255.224.0.00.31.255.2552,097,1522,097,150
/12255.240.0.00.15.255.2551,048,5761,048,574
/13255.248.0.00.7.255.255524,288524,286
/14255.252.0.00.3.255.255262,144262,142
/15255.254.0.00.1.255.255131,072131,070
/16255.255.0.00.0.255.25565,53665,534
/17255.255.128.00.0.127.25532,76832,766
/18255.255.192.00.0.63.25516,38416,382
/19255.255.224.00.0.31.2558,1928,190
/20255.255.240.00.0.15.2554,0964,094
/21255.255.248.00.0.7.2552,0482,046
/22255.255.252.00.0.3.2551,0241,022
/23255.255.254.00.0.1.255512510
/24255.255.255.00.0.0.255256254
/25255.255.255.1280.0.0.127128126
/26255.255.255.1920.0.0.636462
/27255.255.255.2240.0.0.313230
/28255.255.255.2400.0.0.151614
/29255.255.255.2480.0.0.786
/30255.255.255.2520.0.0.342
/31255.255.255.2540.0.0.122
/32255.255.255.2550.0.0.011

Something not working, or a result looks wrong? Report a problem with this tool