Code and data

Subnet calculator

Enter an IPv4 or IPv6 address with a prefix and read the network, the range and the host count. Check a second address, or split the block into smaller prefixes.

A mask in the second box replaces the prefix on the address.

      Runs in your browser. Nothing you type or open is uploaded. Free to use, no account. More code and data tools

      How to use it

      1. Enter an address and a prefix, such as 192.168.1.10/24 or 2001:db8::/32.
      2. Read the network, the range, the counts and the kind of address.
      3. Add another address to see whether it sits inside, or split the block.

      IPv4 masks and IPv6 prefixes

      An IPv4 prefix can be written as /24 or as a dotted mask such as 255.255.255.0. The mask has to be a run of 1s followed by a run of 0s. A /24 of 192.168.1.10 is the network 192.168.1.0, broadcast 192.168.1.255, hosts .1 to .254, 256 addresses and 254 hosts. A /32 is a single address. A /31 has two addresses and both can be used on a point-to-point link. Private, loopback, link-local, shared, multicast and public are named from the address. The old class A to E label is shown as history. The prefix is what routing uses.

      IPv6 takes a prefix from 0 to 128. The page shows the compressed address, the expanded form, and the first and last address. IPv6 has a first and a last address, and the host count is the address count. A /64 names the all-zero interface id as the subnet-router anycast address. A zone id such as %eth0 is noted and left out of the prefix. Leading zeros in an IPv4 octet are read as decimal.

      Private by design

      Privacy

      Everything runs in this page and stays on your device. Addresses you type stay in this tab.

      This page also shows Google ads, which can use cookies. Privacy and cookies explains how.

      Questions

      What does 192.168.1.10/24 include?

      The network 192.168.1.0, the broadcast 192.168.1.255, and the hosts 192.168.1.1 through 192.168.1.254. That is 256 addresses and 254 hosts.

      How is a /31 different?

      A /31 has two addresses and both can be used on a point-to-point link. A /32 is the single address you typed.

      How does IPv6 count hosts?

      The host count is the address count. The range runs from the network address through the last address. A /64 of 2001:db8:1:: is a documentation prefix with 2^64 addresses.

      Can I split a block?

      Choose a longer prefix. A /24 split into /26 is four blocks, and the page lists them. A mask you type in the second box replaces the prefix on the address.

      From the same developer