What is subnet calculator?
A subnet is a smaller network carved out of a larger one. The prefix length shows how many bits belong to the network part of the address. The rest identify hosts inside it.
Network engineers and developers use subnet math when planning home networks, cloud networks and firewall rules.
How to use the subnet calculator
- Enter an IPv4 address.
- Enter the prefix length.
- Read the network, mask, broadcast and host range.
How the subnet calculator works
The subnet mask has the first N bits set to one. The network address is the IP address AND the mask. The broadcast address is the network address OR the inverted mask. Usable hosts are the total addresses minus two, except for /31 and /32.
Worked example
Common uses of the subnet calculator
- Planning home or office networks.
- Cloud VPC and firewall design.
- Studying for networking exams.
- Checking whether two addresses share a subnet.
- Writing access lists.
Tips and common mistakes
Leave room to grow. A /24 gives 254 hosts, a /23 gives 510.
Private ranges are 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16.
Background: what to know before you rely on it
IPv4 addresses are 32 bit numbers written as four decimal bytes. Early networks used fixed classes A, B and C, which wasted many addresses. In 1993 classless inter domain routing, or CIDR, replaced classes with a flexible prefix length so that blocks could fit real needs. Subnetting lets an organization split one block into many networks, which improves security and reduces broadcast traffic. The rule of subtracting two hosts comes from reserving the first address for the network and the last for the broadcast.
Private, free and fast
This tool runs entirely in your browser. What you type or choose is not uploaded to a server and is not saved after you close the page, which keeps it fast and private. It is free to use as often as you like. See more in all developer tools, or browse the full list of tools.
Frequently asked questions
What does /24 mean?
The first 24 bits are the network part, so the mask is 255.255.255.0.
Why minus two hosts?
One address is the network and one is the broadcast.
Does it support IPv6?
Not yet. This tool is for IPv4.
Is the IP sent anywhere?
No. The math runs in your browser.
Related tools
Binary, Decimal and Hex Converter
Enter a number and its base. The converter shows the same value in binary (base 2), octal (8), decimal...
SEO ToolsDNS Lookup Tool
Enter a domain and a record type to see its DNS records and TTL, such as the IP address, mail servers,...
ConvertersData Storage Converter
Enter a size and choose its unit to see it in every other storage unit. Decimal units use 1,000 steps...
ConvertersText to Binary Converter
Type text to get its binary or hexadecimal code, or paste binary or hex to read the text. It uses UTF8,...
Developer ToolsJSON Formatter and Validator
Paste your JSON and the tool checks that it is valid, then formats it with indentation or compresses it...
Developer ToolsBase64 Encoder and Decoder
Base64 turns text or bytes into a safe string of letters and numbers. Choose encode or decode, paste...
Results are for information and education. For legal, financial, medical or security decisions, check with a qualified professional. Do not paste live secrets into any website.