IP & CIDR Subnet Calculator

Type an address with a prefix such as 10.20.30.40/22, a dotted netmask such as 192.168.1.10/255.255.255.0, or an IPv6 address such as 2001:db8::1/48. The calculator returns the network address, the usable host range, the broadcast address, the wildcard mask, binary and hexadecimal views, the address class and range type, and the reverse DNS name. It also splits a network into smaller subnets and converts between prefix lengths and netmasks in both directions. Everything is computed in your browser.
What CIDR is: CIDR stands for Classless Inter-Domain Routing, the way networks have been sized since 1993. It is written as an address followed by a slash and a number, such as 10.20.30.40/22. Underneath it all an IPv4 address is 32 bits and an IPv6 address is 128 bits. The number after the slash is the prefix length: it counts how many bits from the left name the network, and the bits that are left over name one machine inside that network. A /22 keeps 22 bits for the network and leaves 10 bits for the host.

Reading the size: the host bits are what make a block big or small, because every extra bit doubles the count. A /24 leaves 8 host bits, which is 256 addresses; a /25 leaves 7 and halves that to 128; a /23 leaves 9 and grows to 512. A longer prefix is always a smaller block: /32 is one address, /31 is a two-address link, /30 is four addresses, /24 is an ordinary small network and /8 is a very large one. The same value can be written as a netmask, where the network bits become ones, so /24 and 255.255.255.0 mean the same thing; the table further down lists every IPv4 prefix from /0 to /32.

Why it is called classless: before CIDR, addresses were handed out in a few fixed sizes known as class A, class B and class C. Most organisations needed far less than a class B and far more than a class C, so a great deal of space was wasted. CIDR dropped the fixed classes and lets a block be exactly the size that is needed. The address class shown in the results below is kept as a historical label only, because no current router makes decisions from it.

What it is used for: a device decides whether a destination can be reached directly on the local link or has to be handed to a router by comparing network addresses. For 10.20.30.40/22 the network address is the address with the 10 host bits set to zero, so 10.20.30.40 and 10.20.31.9 both sit in 10.20.28.0/22 and reach each other directly, while 10.20.32.5 sits in 10.20.32.0/22 and has to leave through a router. The network address row in the result table below shows that value for whatever address you type. IPv6 works the same way with larger numbers: a /64 is the usual size for one network segment, a /48 is a common block handed to a whole site, and a /128 is a single address, the counterpart of a /32.
Enter an address to see the network details.
The address is shown bit by bit once a value is entered.
New prefix length or number of subnets
Splitting produces a table of subnets, up to 256 rows at a time.
Netmask
How the numbers are worked out: the prefix length is how many bits from the left are the network part, and the remaining bits are hosts. The network address is the address with all host bits set to zero, the broadcast address has them all set to one. For IPv4 a normal point-to-point network keeps two addresses aside, so a /24 has 256 addresses but 254 usable hosts. A /31 has no broadcast and both addresses are usable, and a /32 is a single host route.

Notes on correctness: id:address/prefix without a prefix is treated as a single host. A netmask with a gap in the middle, such as 255.0.255.0, is invalid and is rejected rather than guessed at. IPv6 uses the same rules with 128 bits; the traditional subnet-zero and all-ones rules belong to old classful IPv4 routing and are not applied here.

Privacy: nothing on this page contacts the network. Addresses you type stay in the browser and are not logged or transmitted anywhere.