Subnet Calculator

Enter an IP address and a prefix length (CIDR) to get the network address, broadcast address, subnet mask, host count and usable IP range instantly. Reverse lookup from a subnet mask and VLSM subnetting tables are built in, and the binary view shows exactly where the network bits end and the host bits begin. Useful for network design and for CCNA or Network+ study.

This tool has been used times.
1

Calculate the Subnet Mask and Network Address

Pick an IP address and a prefix length, and every value is calculated as you type. Each prefix option lists its subnet mask, so the dropdown doubles as a CIDR to subnet mask conversion chart.

You can paste a full CIDR string such as 192.168.1.10/24 and it will be parsed. Typing a subnet mask (255.255.252.0, for example) switches the prefix length to the matching value automatically.

Network bits and host bits in binary Network bits Host bits
2

Same Network Check

Enter a second IP address to check whether it belongs to the same subnet as the network defined above.

3

Split into Subnets (VLSM)

Break the network from step 1 into smaller subnets and list the network address, usable IP range and broadcast address for each one. Handy for checking your answers on CCNA or Network+ subnetting questions.

4

Try Common Network Setups

Load a typical configuration with one tap and compare the results and the binary view.

How to Use

  1. Type an IP address (192.168.1.10, for example) and choose a prefix length such as /24. Pasting the full CIDR string 192.168.1.10/24 works too. If all you have is the subnet mask, enter it in the “Subnet mask (reverse lookup)” field and the prefix length switches to match.
  2. The network address, host count and the rest are calculated straight away, and the binary view shows the boundary between the network bits (blue) and the host bits (orange).
  3. Put a second address into “Same Network Check” to see whether it sits in the same subnet.
  4. Choose a new prefix length under “Split into Subnets (VLSM)” to list every resulting subnet. Your input is saved automatically and restored the next time you open the page.

How the Math Works

CIDR notation (/24 and so on)Says how many of the 32 bits in an IP address belong to the network. A /24 means the top 24 bits are the network part
Subnet maskThe same 32 bits written as 1 for the network part and 0 for the host part. A /24 corresponds to 255.255.255.0
Network addressThe bitwise AND of the IP address and the subnet mask. Every host bit is 0, and it identifies the network itself
Broadcast addressEvery host bit set to 1. Traffic sent here reaches all hosts on the same network at once
Usable hosts = 2^(32−n) − 2The total address count minus the network address and the broadcast address. A /24 gives 256 − 2 = 254 hosts
Wildcard maskThe subnet mask with every bit inverted. Used in router ACLs (access control lists) and similar configuration
Subnetting (VLSM)Extending the prefix by n bits divides the network into 2^n equal subnets. Going from /24 to /26 produces 2^2 = 4 of them
Private IP ranges10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. These are free to use inside any organisation
/31 and /32A /31 is for point-to-point router links (RFC 3021) and both addresses are usable. A /32 identifies a single host

Frequently Asked Questions

Why does a /24 have only 254 usable IP addresses?
A /24 leaves 8 bits for the host part, so the total is 2^8 = 256 addresses. The first one is the network address and the last one is the broadcast address, and neither can be assigned to a host, which leaves 256 − 2 = 254 usable addresses.
What prefix length is subnet mask 255.255.255.0?
It is a /24. Written in binary, 255.255.255.0 starts with 24 consecutive ones, so the prefix length is 24. By the same logic 255.255.0.0 is a /16 and 255.255.255.128 is a /25. Enter any mask in the “Subnet mask (reverse lookup)” field above and the prefix length switches to match.
How many hosts fit in subnet mask 255.255.252.0?
255.255.252.0 is a /22. The host part is 10 bits, so there are 2^10 = 1,024 addresses in total and 1,022 usable once the network and broadcast addresses are removed. For comparison, 255.255.254.0 is a /23 with 510 hosts and 255.255.248.0 is a /21 with 2,046 hosts.
How many subnets do you get splitting a /24 into /26?
Four. Extending the prefix from 24 to 26 adds 2 bits, so the network divides into 2^2 = 4 equal parts. Each subnet holds 64 addresses, of which 64 − 2 = 62 are usable by hosts. Use “Split into Subnets (VLSM)” above to list the network address and IP range of every subnet.
What is VLSM (variable length subnet masking)?
It is the practice of carving one network into subnets of different sizes to match how many hosts each segment actually needs. Inside a /24 you might give a 50 seat department a /26 (62 hosts) and a router link a /30 (2 hosts), varying the prefix length per segment so fewer addresses go to waste. Switch the prefix length above to see whether a given size covers the hosts you need.
What is the difference between a private IP and a public IP?
Private IP addresses work only inside a home or company network, and three ranges are reserved for them: 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. A public IP address is unique across the whole internet. Devices at home hold private addresses and the router translates them to its public address through NAT.
How do you tell whether two IP addresses are on the same network?
Apply a bitwise AND between each IP address and the subnet mask to get its network address. If both results match, the two addresses share a network and can talk to each other directly without passing through a router. The “Same Network Check” above does this for you.

Please also review the Terms of Use for this web app before using it.

Found a bug or have feedback? Let us know here.

Report bugs, display issues, usability problems, or suggestions for improvement.
Consent
・This form is for bug reports only. In principle, we do not respond to individual submissions.
・If a submission contains defamatory, threatening, or otherwise inappropriate content, we may take appropriate action based on logs such as IP addresses.

目次