Skip to content

Subnet calculator (CIDR)

Runs in your browserNothing is uploadedThis runs entirely in your browser. Nothing is uploaded.

Enter something like 192.168.1.10/24 and get the network address, broadcast, usable host range and subnet mask. IPv6 prefixes work too.

Input

IPv4 or IPv6. Leave the prefix off to treat it as a single host.

Output

192.168.1.0/24
Network address
192.168.1.0
Broadcast
192.168.1.255
First host
192.168.1.1
Last host
192.168.1.254
Usable hosts
254
Block size
256
Subnet mask
255.255.255.0
Wildcard mask
0.0.0.255
Type
Private (internal)
Input192.168.1.10/24This networkNetwork 192.168.1.0Broadcast .255Usable .1 - .254254 hostsIPv6 prefixes such as 2001:db8::/48 are supported as well.
A /24 holds 254 usable hosts rather than 256 because the first address is the network itself and the last is the broadcast address. Subtract those two when sizing a subnet.
All tools

Why this one

IPv6 without losing digits
128-bit addresses and host counts past 18 quintillion are computed exactly, not rounded. Output collapses only the longest run of zeros to “::” (RFC 5952), so it matches what your equipment prints.
Honest about /31 and /32
Host counts are usually “minus two”, but that subtraction breaks on point-to-point /31 and single-host /32 — done naively it reports minus one host. Both are handled separately and explained.
Reserved ranges are named
Private, loopback, link-local and CGNAT (100.64.0.0/10) are identified. Useful when “it cannot reach the internet” turns out to be an address that was never routable.

How to use it

  1. Enter a CIDR

    Use the form 192.168.1.10/24. With the prefix left off, IPv4 is treated as /32 and IPv6 as /128.

  2. Read the result

    The address is normalised to the network it belongs to. The host range is in the form you can type straight into equipment.

  3. Take it

    “Copy the result” by the heading gives you every value in the table, one “label: value” per line.

Terms and how to read them

CIDR (the /24 part)
How many leading bits are the network. With /24 the first 24 bits are shared and the remaining 8 number each device. A bigger number means a smaller block.
Network address and broadcast
The first and last address in the block. In IPv4 neither can be assigned to a device, which is where “minus two” comes from. IPv6 has no broadcast.
Wildcard mask
The subnet mask with its bits inverted. Some routers expect it instead of the mask in access lists.
What one more prefix bit does
Halves the range exactly. /24 holds 256 addresses, /25 holds 128, /26 holds 64. Taking a bit away doubles it. When you are a few addresses short, the answer is usually one bit fewer — and the thing to check then is whether the larger range now overlaps the network next door.
Why 256 rather than 255
An octet holds 0 through 255, which is 256 values. Subtracting 2 for usable hosts is because the first (network) and last (broadcast) of those 256 are reserved — not because the range itself is 255 wide.
CGNAT (100.64.0.0/10)
A middle tier carriers hand to subscribers: neither globally routable nor private. If your address comes from here, nothing outside can reach your equipment directly. It is one of the most common reasons port forwarding on a home connection quietly fails.

Questions

Is what I type sent anywhere?
No. It is all computed in the browser, so internal addressing plans stay on your machine.
Why does /31 show two hosts?
That is correct. RFC 3021 allows both addresses of a /31 to be used on a point-to-point link between routers.
Why is the IPv6 host count so large?
A /64 holds about 18 quintillion addresses. That size is the normal unit in IPv6; the design does not try to conserve them.
The network address shown is not the address I typed.
That is correct. Given 192.168.1.10/24, the network that host belongs to is 192.168.1.0/24, so the result is normalised to it. The point of the calculation is the block the host sits in, not the host itself.
Which range should I use for an internal network?
One of the reserved private ranges: 10.0.0.0/8, 172.16.0.0/12 or 192.168.0.0/16. None of the three is routed on the internet, so nothing you assign collides with the outside world. At small scale, laying out 192.168.x.0/24 blocks is the easiest to live with; sites tend to move to 10.x.x.x once there are enough locations to want summarised routes.
Can it tell me whether two CIDRs overlap?
It expands one CIDR at a time. To check an overlap, run both and compare the first and last addresses: if either range starts inside the other, they overlap. Handing out two blocks that overlap without noticing is the most common failure in network design.
Sponsored links