Subnet Calculator

CIDR math for IPv4 and IPv6: host ranges, a live bit view, equal splits, VLSM plans, route aggregation, and membership checks.

Example input

A CIDR (10.20.4.0/22 or 2001:db8::/48), an address and mask (192.168.1.37 255.255.255.0), or a bare address.

Prefix length /22 (22 network bits, 10 host bits)

Network bits Host bits

10.20.4.0/22
CIDR
10.20.4.0/22
Netmask
255.255.252.0
Wildcard mask
0.0.3.255
Network address
10.20.4.0
Broadcast address
10.20.7.255
First usable host
10.20.4.1
Last usable host
10.20.7.254
Usable host count
1022
Total addresses
1024
Binary netmask
11111111.11111111.11111100.00000000
IP class
A
Address type
Private (RFC 1918)

4 subnets of /24, 254 usable hosts each.

4 subnets
SubnetFirst hostLast hostBroadcastUsable
10.20.4.110.20.4.25410.20.4.255254
10.20.5.110.20.5.25410.20.5.255254
10.20.6.110.20.6.25410.20.6.255254
10.20.7.110.20.7.25410.20.7.255254

Related tools

What it does

Works out everything about an IPv4 or IPv6 network: network and broadcast address, usable host range, host count, netmask, wildcard mask, class, and scope such as private, carrier-grade NAT, link-local, or documentation. A bit view draws the boundary between network and host bits, and a slider moves the prefix length live. It also splits a network into equal subnets, plans variable length subnets (VLSM) from a list of host counts, merges a list of CIDRs into the fewest routes, checks whether an address belongs to a network, and shows the neighboring blocks.

How to use it

Type a CIDR like 192.168.1.0/24 or 2001:db8::/48, an address and mask like 192.168.1.37 255.255.255.0, or a bare address. Drag the prefix slider to resize the network, or enter how many hosts you need and apply the suggested prefix. Then pick a planning tool: split into a number of equal subnets, list host counts one per line for a VLSM plan, paste CIDRs to aggregate, or enter an address to test. Any subnet in a result can be clicked to calculate it, and tables copy or download as CSV.

Why this one

Most online subnet calculators only handle IPv4, bury the answer under ads, or cap how many subnets you can split into. This one covers IPv4 and IPv6 in the same box, shows the bits so the math is visible, plans VLSM and supernets in the same place, works offline, and your files and inputs never leave your device.

FAQ
Why does a /31 show 2 usable hosts instead of 0?
RFC 3021 allows /31 networks on point-to-point links to use both addresses as hosts, since there is no room for a separate network and broadcast address. This tool follows that rule, and a /32 is treated as a single host address.
How does the VLSM planner choose subnet sizes?
Each line is a host count, optionally after a name. Every subnet gets the smallest block whose usable addresses cover that count, the blocks are placed largest first from the start of the network so they stay aligned with no gaps, and whatever is left over is listed as free CIDR blocks. If the counts do not fit, it says which subnet ran out of room.
Is there an API, and does anything leave my browser?
On the page all the address math runs locally in JavaScript, so your files and inputs never leave your device. A GET endpoint at /api/subnet-calculator exists for scripts and curl: it takes the same network text, or two CIDRs separated by a comma to compare them, and a split parameter for equal subnets.

Keyboard shortcuts: press ? anywhere on this page to see them.