ProxyPortals

Free network tool

Subnet Calculator

Calculate IPv4 and IPv6 network boundaries, masks, wildcards, usable hosts, and VLSM splits. Everything runs in your browser — your CIDR never leaves this page.

Accepts ip/prefix, dotted mask, wildcard, or host count — e.g. 192.168.1.0 255.255.255.0.

Enter a network CIDR above, or tap an example chip.

Split subnet (VLSM)

Carve the network above into smaller equal prefixes. Results are capped at 256 rows.

CIDR reference (/8–/32)

Subnet masks and CIDR notation

An IPv4 address is 32 bits, usually written as four decimal octets. A subnet mask (or prefix length) tells you how many of those bits identify the network versus the host. A mask of 255.255.255.0 means the first 24 bits are fixed for the subnet — written as /24 in CIDR notation. The calculator accepts classic CIDR (10.0.0.0/8), a dotted mask, an inverse wildcard mask, or a requested host count and converts them to a prefix before computing boundaries.

CIDR replaced the old “class A/B/C” sizing for most real-world design, but you may still see classful labels (A, B, C) in output for learning. Modern routing uses prefix lengths everywhere: BGP, firewalls, cloud VPCs, and Docker networks all speak in slashes.

Network, broadcast, and usable hosts

For a typical IPv4 subnet, the lowest address in the range is the network ID (all host bits zero) and the highest is the broadcast (all host bits one). Addresses in between are assignable to interfaces — that is the usable host count. The familiar formula is 2^(32−prefix) − 2 for prefixes /30 and smaller in classical LANs.

Two important exceptions appear in production constantly. A /31 point-to-point link (RFC 3021) treats both addresses as usable on the wire — you get exactly two endpoints with no wasted broadcast. A /32 is a single-host route: one address, often used for loopbacks or anycast service addresses. The calculator mirrors those rules so your numbers match what routers and certification exams expect.

Wildcard masks and binary view

A wildcard mask is the bitwise inverse of the subnet mask. Access lists on Cisco-style gear match “don’t care” bits using wildcards (0.0.0.255 for a /24). Seeing binary expansions of the mask and your input IP helps when you are learning bitwise AND operations or debugging ACLs. Hex output is included for IPv4 to correlate with packet captures.

Private, reserved, and special-use ranges

RFC 1918 reserves 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16 for private LANs. These addresses are not globally routable; NAT translates them to public space at the edge. Other notable IPv4 blocks include loopback (127.0.0.0/8), link-local APIPA (169.254.0.0/16), CGNAT carrier space (100.64.0.0/10), and multicast. The tool labels the address type so you do not accidentally plan public BGP for a private lab range.

VLSM and splitting subnets

Variable Length Subnet Masking (VLSM) means carving a larger prefix into smaller pieces of different sizes — for example splitting a /24 into four /26 segments for four departments. The split tool supports specifying a new prefix length (must be equal or longer than the parent) or asking for N equal subnets where N is a power of two. Results cap at 256 rows so the page stays responsive on huge splits like /8 → /16.

When planning VLSM on paper, always start from the largest subnet need downward; otherwise you fragment space and waste addresses. In IPv6, address space is vast, but /64-per-LAN conventions still matter for SLAAC and neighbor discovery.

IPv6 prefixes

IPv6 uses 128-bit addresses, commonly shown compressed (2001:db8::/32). There is no IPv4-style broadcast; instead you work with subnet ranges from first to last address in the prefix. Typical allocations: /48 or /56 to a site, /64 per LAN segment, /128 for a single interface. The calculator expands and compresses addresses, classifies ULA (fc00::/7), link-local, multicast, and documentation space (2001:db8::/32).

How to use this calculator

Type a network and watch live results (debounced) or press Calculate. Use Random practice to drill conversions. Share a link with ?ip= in the query string — the page updates the URL without reloading so you can bookmark a scenario. Copy summary dumps all major fields for documentation tickets. Because logic runs locally, air-gapped networks can still use it offline once the page is loaded.

Reverse DNS zone hint

For IPv4, the tool prints the in-addr.arpa zone name used for PTR records (octets reversed). That is the name you would query in a DNS tool when verifying mail-server reverse DNS.

Exam and interview drills

Subnetting questions often ask you to find the broadcast address of 172.30.45.67/19 or how many /27 networks fit in a /24. Work by writing the prefix in binary, masking the host bits, then incrementing the network portion. The random practice button generates private-space examples so you can check your mental math against the calculator. When studying IPv6, focus on prefix boundaries (/48, /56, /64) rather than memorizing full 128-bit addresses — compression rules matter more on the job than handwriting hex.

Cloud consoles still show CIDR strings when you create VPCs, subnets, and security groups. Matching what the UI calls “IPv4 CIDR block” to first/last usable addresses prevents off-by-one errors when sizing DHCP pools and excluding network/broadcast addresses on legacy designs.

FAQ

What is a subnet mask?

A subnet mask marks which bits of an IP address identify the network versus the host. In dotted form, 255.255.255.0 means the first 24 bits are network bits.

What is CIDR notation?

CIDR writes the prefix length after a slash, such as 192.168.1.0/24, instead of a separate mask. It is the standard way to describe IPv4 and IPv6 prefixes today.

How do I calculate usable hosts?

For most IPv4 subnets, usable hosts = 2^(32−prefix) − 2 (network and broadcast). Exceptions: /31 has 2 usable (RFC 3021) and /32 has 1.

Why subtract 2 from the host count?

Traditionally the all-zeros host field is the network address and all-ones is broadcast. Point-to-point /31 links skip that rule per RFC 3021.

What is a wildcard mask?

A wildcard mask is the inverse of a subnet mask (0.0.0.255 for /24). Access-control lists on some routers use wildcards instead of CIDR.

What is the difference between /24 and /25?

A /24 has 256 addresses (254 usable). A /25 splits that space in half: 128 addresses and 126 usable each.

Why does /31 have two usable addresses?

RFC 3021 allows /31 for point-to-point links so both addresses can be used on the endpoints without wasting a broadcast address.

What are private IP ranges?

RFC1918 reserves 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 for private networks. They are not routed on the public internet.

What is VLSM?

Variable Length Subnet Masking means carving a larger network into unequal or smaller prefixes (for example splitting a /24 into /26s) so each segment gets only the size it needs.

How do IPv6 prefixes work?

IPv6 uses a prefix length from 0–128. Common sizes are /64 for a LAN and /48 or /56 for a site allocation. There is no broadcast address like IPv4.

Last updated: October 2026