How to use the subnet calculator
- 1Type an IPv4 or IPv6 address followed by a prefix length, such as 192.168.1.0/24 or 2001:db8::/32. You can also enter an IPv4 subnet mask, such as 172.16.5.9 255.255.240.0.
- 2Read the results: network address, broadcast address, subnet mask, wildcard mask, first and last usable host, total addresses and usable hosts. Click the copy icon next to any value.
- 3Use Split into smaller subnets to divide the block, for example a /24 into four /26 networks, and copy the list of subnets.
- 4Open the IP range to CIDR tab if you have a start and end address and want the CIDR blocks that cover it.
How subnetting works
An IP address is split in two parts: the network part, which identifies the subnet, and the host part, which identifies a device inside it. The prefix length, written after a slash, says how many leading bits belong to the network. In 192.168.1.0/24, 24 bits are the network and the remaining 8 bits give 256 addresses. This IP subnet calculator, which works as both an IPv4 subnet calculator and an IPv6 subnet calculator, does that arithmetic for you.
The subnet mask is the same information written as an address: a /24 is 255.255.255.0, a /20 is 255.255.240.0. The wildcard mask is its inverse (0.0.0.255 for a /24), which Cisco access lists and OSPF use. The network address is the first address in the block, with all host bits zero. In IPv4, the broadcast address is the last, with all host bits one. Neither can be assigned to a device, so usable hosts are the total minus two. The exceptions are /31 networks, which use both addresses for point-to-point links, and /32, which is a single host.
Subnetting lets you carve a larger block into smaller ones. Each extra bit in the prefix halves the block, so a /24 splits into two /25s, four /26s or sixteen /28s. The same logic applies to IPv6, but addresses are 128 bits long, there is no broadcast address and a typical site gets a /48 or /64. For IPv6 the calculator shows the first and last address, the total count and how many /64 subnets fit.
The address type tells you whether a range is private (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16), loopback, link-local, multicast or public. All of it is calculated in your browser, so you can try network plans without sharing them.
When developers reach for it
Planning a network
Work out how many hosts a subnet mask gives you, and choose a prefix length that fits a VLAN or a cloud VPC.
Cloud and firewall rules
Use it as a network address calculator to find the address and range for a security group, route table or firewall rule, and split a VPC block into subnets.
Reading router configs
Convert between a subnet mask, a wildcard mask and a prefix length when you read an access list or routing table.
Studying for networking exams
Check your subnetting by hand against the answer, including the broadcast address and host range.
Frequently asked questions
How many usable hosts are in a /24?
+
A /24 has 256 addresses and 254 usable hosts, because the first address is the network address and the last is the broadcast address. The same usable hosts calculator works for any prefix length.
What is a wildcard mask?
+
This wildcard mask calculator shows it as the inverse of the subnet mask: the bits that can vary are 1 and the fixed bits are 0. A /24 has the subnet mask 255.255.255.0 and the wildcard mask 0.0.0.255. Routers use it in access lists and OSPF network statements.
Does the calculator support IPv6?
+
Yes. Enter an IPv6 address with a prefix, such as 2001:db8::/32, to get the network prefix, first and last address, total addresses and the number of /64 subnets. IPv6 has no broadcast address.
What are /31 and /32 networks?
+
A /31 has two addresses and is used for point-to-point links (RFC 3021), so both are usable. A /32 is a single host address, used for loopbacks and host routes. Neither has a broadcast address.
Can I enter a subnet mask instead of a prefix?
+
Yes. Type the address and mask separated by a space, such as 10.1.2.3 255.255.0.0, or an address with a wildcard mask. The tool works out the prefix length.
Is my data sent anywhere?
+
No. All the calculations happen in your browser, so the addresses and plans you try are not uploaded.
Related tools
CIDR Calculator
Convert CIDR to an IP range, or an IP range to the shortest list of CIDR blocks, with netmask and host counts for IPv4 and IPv6.
Chmod Calculator
Work out Unix file permissions: tick read/write/execute for owner, group and others, or type an octal mode like 755 or a string like rwxr-xr-x. Get the chmod command in numeric and symbolic form, including setuid, setgid and sticky bits.
Binary, Hex & Decimal Converter
Convert numbers between binary, octal, decimal, and hexadecimal. Real-time conversion with input validation and BigInt precision for large values.
Regex Tester
Test JavaScript regular expressions with live match highlighting, g/i/m/s/u/y flags, a capture-group breakdown for every match, and a replace preview. Runs off the main thread, so a runaway pattern can't freeze the tab.