The free IP subnet calculator for IPv4 and IPv6
An IP subnet calculator is an online tool that takes an IP address and a subnet mask (or a CIDR prefix) and instantly works out everything about the network that address belongs to: the network address, the broadcast address, the first and last usable host, the total number of hosts, the wildcard mask and more. Instead of converting octets to binary and counting bits by hand, you type one line and read the answer. ipcalc.net is a fast, accurate IP calculator that handles both IPv4 and IPv6, runs entirely in your browser and never asks you to sign up.
Whether you are studying for a networking exam, planning a VPC, configuring a router or just trying to understand what 192.168.1.0/24 means, a good subnet calculator saves time and prevents expensive mistakes. A single wrong bit in a mask can overlap two networks, break routing or open a firewall rule far wider than intended.
How to use this subnet calculator
- Type an IPv4 address with a prefix (
10.0.0.1/22) or a dotted mask (10.0.0.1 255.255.252.0) into the box above. A bare IP address also works. - Adjust the prefix with the slider, the drop-down or by clicking bits in the 32-bit ruler to see the network and host boundary move.
- Read the results: network address, broadcast address, usable host range, subnet mask, wildcard mask, hexadecimal and integer forms, and reverse DNS name.
- Copy any value with one click, or press Share to send a link that reopens the exact same calculation.
What is a subnet mask?
An IP subnet mask is a 32-bit number that splits an IPv4 address into a network portion and a host portion. Wherever the mask has a 1, that bit of the address identifies the network; wherever it has a 0, the bit identifies a host inside that network. The mask 255.255.255.0 is written in binary as 24 ones followed by 8 zeros, so the first three octets name the network and the last octet names the host. Devices compare the mask against a destination address to decide whether a packet stays on the local network or must be sent to a gateway. If you have ever wondered about an ip subnet mask gateway setup, this is the rule: a host talks directly to any address inside its own subnet and uses its default gateway for everything else.
CIDR notation explained
CIDR stands for Classless Inter-Domain Routing. CIDR notation writes the mask as a slash followed by the number of network bits, so 255.255.255.0 becomes /24 and 255.255.255.192 becomes /26. It replaced the rigid class A, B and C system in 1993 and lets networks of any size be allocated, which is why one subnet mask calculator is not enough on its own: you also need to convert between masks, prefixes and ranges. Our CIDR calculator and subnet mask calculator do exactly that.
| CIDR | Subnet mask | Total IPs | Usable hosts |
|---|---|---|---|
| /8 | 255.0.0.0 | 16,777,216 | 16,777,214 |
| /16 | 255.255.0.0 | 65,536 | 65,534 |
| /24 | 255.255.255.0 | 256 | 254 |
| /26 | 255.255.255.192 | 64 | 62 |
| /28 | 255.255.255.240 | 16 | 14 |
| /30 | 255.255.255.252 | 4 | 2 |
What you get from every calculation
- Network and broadcast address – the first and last address of the subnet, both reserved in standard subnets.
- Usable IP range – the hosts you can actually assign, plus the exact host count. Need the reverse? Try the IP range calculator.
- Wildcard mask – the inverse of the subnet mask used in Cisco access lists and OSPF. See the wildcard mask calculator.
- Address class and scope – whether the address is private, public, loopback, link-local, multicast or CGNAT, with its legacy IP address class.
- Binary, hex and integer forms – useful when debugging packet captures or writing firewall rules.
- Cisco snippets – ready-to-paste interface and access-list lines.
IPv4 versus IPv6 subnetting
IPv4 addresses are 32 bits long, which gives about 4.3 billion addresses and makes careful subnetting essential. IPv6 addresses are 128 bits long, so address conservation is no longer the goal; hierarchy and clean boundaries are. The standard IPv6 LAN is a /64, sites usually receive a /48 or /56, and subnetting on nibble (4-bit) boundaries keeps addresses readable. Our IPv6 subnet calculator uses exact 128-bit arithmetic to show the prefix, address range, number of /64 subnets and canonical RFC 5952 compression.
Private IP ranges and special addresses
Not every address is meant for the public Internet. RFC 1918 reserves 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 for private networks, which is why almost every home router hands out 192.168.x.x addresses. Carrier-grade NAT uses 100.64.0.0/10, link-local addresses live in 169.254.0.0/16, and 127.0.0.0/8 is loopback. The calculator labels each of these automatically so you can tell at a glance what kind of address you are looking at. For a full list, read our guide to IP address classes and private IP ranges.
Planning with VLSM
Real networks rarely need subnets of identical size. Variable Length Subnet Masking (VLSM) lets you give a 60-host office a /26 and a router-to-router link a /30 from the same parent block, wasting almost nothing. The VLSM calculator sorts your requirements, aligns each block on a binary boundary and shows the remaining free space, and the VLSM guide explains VLSM vs FLSM and VLSM vs CIDR in plain language.
Learn subnetting and practise it
Subnetting is a skill that rewards repetition. Start with our subnetting explained guide, keep the subnet mask cheat sheet open while you work, and test yourself with the subnetting practice quiz, which generates random questions and checks your answers with the same engine that powers this calculator.
Accurate, private and free
Every result is calculated with unsigned 32-bit integers for IPv4 and arbitrary-precision integers for IPv6, so there are no floating-point or overflow surprises, and the edge cases that trip up other tools — /31 point-to-point links under RFC 3021, /32 host routes and /0 default routes — are handled correctly. Calculations happen locally in your browser. If you want to automate lookups, the free REST API returns the same data as JSON, and if you just need your own address, what is my IP shows it in one click.