Skip to main content

Subnet calculator for IPv4 and IPv6

Enter an IP address with a prefix or a subnet mask to get the network and broadcast address, the usable host range, the masks and the number of hosts, or split the network into smaller subnets. It all runs in your browser: no account is needed.

One box for IPv4 and IPv6

Type 192.168.1.10/24, 10.0.0.1 255.255.252.0 or 2001:db8::/48. The calculator reads the address, the prefix or the subnet mask, and tells you what is wrong if it cannot.

Find out more

Every number you need for a subnet

Network and broadcast address, usable host range and count, subnet and wildcard mask, class, address type and a binary view. For IPv6, the full range and its exact size.

Find out more

Split a network into equal subnets

Enter how many subnets you need and the calculator lists each one with its first and last host and broadcast address.

Find out more

Key takeaways

  • This tool calculates an IPv4 or IPv6 subnet from an address and a prefix length in CIDR (Classless Inter-Domain Routing) notation, or for IPv4 a subnet mask, entirely in your browser.
  • For IPv4 it shows the network and broadcast addresses, the first and last usable host, the number of usable hosts, the subnet and wildcard masks, the address class and range type, and a binary view.
  • It follows RFC 3021 for /31 networks, which have two usable addresses and no broadcast address, and counts a /32 as a single host.
  • For IPv6 it shows the compressed (RFC 5952) and expanded address, the first and last address of the range, and the exact number of addresses and of /64 subnets.
  • A network can be split into 2 to 256 equal subnets; the tool is free and needs no login.

Frequently asked questions.

A subnet mask marks which part of an IPv4 address names the network and which part names a host on it. In binary it is a run of ones followed by zeros: 255.255.255.0 is 24 ones and 8 zeros, so the first three numbers of the address identify the network and the last one identifies the host. Two addresses are on the same subnet when they match in every bit the mask covers.
The number after the slash is the prefix length in CIDR (Classless Inter-Domain Routing) notation: how many leading bits of the address belong to the network. /24 is the mask 255.255.255.0 and leaves 8 bits for hosts, which makes 256 addresses. Every step shorter doubles the size, so a /23 has 512 addresses and a /16 has 65,536. CIDR replaced the fixed class A, B and C networks in 1993 (RFC 4632).
Two to the power of the host bits, minus two, because the first address is the network address and the last is the broadcast address. A /24 has 256 addresses and 254 usable hosts, a /29 has 8 and 6, and a /30 has 4 and 2. Two prefixes are exceptions: a /31 has 2 usable addresses and no broadcast address, for point-to-point links (RFC 3021), and a /32 is a single host.
Count the one bits. Each 255 is 8 bits, and the last non-zero number adds the rest: 128 is 1 bit, 192 is 2, 224 is 3, 240 is 4, 248 is 5, 252 is 6 and 254 is 7. So 255.255.240.0 is 8 + 8 + 4 = /20. In the calculator, type the mask after the address, as in 10.0.0.1 255.255.240.0, and it shows the prefix.
The inverse of a subnet mask: every 1 bit becomes 0 and every 0 becomes 1, so 255.255.255.0 becomes 0.0.0.255. Router access lists and some routing protocol settings use it to say which bits of an address must match. The calculator shows it next to the subnet mask, and if you type a wildcard mask where a subnet mask belongs, it tells you the subnet mask it stands for.
RFC 1918 sets aside three IPv4 ranges for private networks: 10.0.0.0/8, 172.16.0.0/12 (172.16.0.0 to 172.31.255.255) and 192.168.0.0/16. They are not routed on the public internet. The calculator also recognizes loopback (127.0.0.0/8), link-local (169.254.0.0/16), the carrier-grade NAT range 100.64.0.0/10, the documentation ranges and the IPv6 special ranges, and labels the address you enter.
Each extra prefix bit halves a subnet: a /24 splits into two /25s, four /26s or eight /27s. Enter the network, then the number of subnets under "Split into equal subnets", and the calculator lists every subnet with its first and last host and its broadcast address. A count that is not a power of two rounds up, so asking for 6 subnets of a /24 gives eight /27s with 30 usable hosts each.
IPv6 uses prefix lengths only: there are no subnet masks and no broadcast addresses. A single network segment is normally a /64, because most IPv6 addresses carry a 64-bit interface identifier (RFC 4291), and a site is commonly assigned a /48 or a /56, which holds 65,536 or 256 of those /64 networks. For IPv6 the calculator shows the first and last address of the range and its exact size.
Leading zeros in each group are dropped, and the longest run of all-zero groups is replaced by "::" once, as RFC 5952 recommends: 2001:0db8:0000:0000:0000:0000:0000:0001 becomes 2001:db8::1. A single zero group stays as 0. The calculator shows both the short and the expanded form of any address you enter.
No. Every calculation runs in your browser: what you type is not sent to HostTracker, and no account is needed. To share a result, the "Copy link" button puts the address in a link you can paste.

Part of HostTracker's website monitoring software.