Subnet Calculator
Enter an IPv4 address and a prefix length to get the network address, broadcast address, subnet mask, wildcard mask, usable host range, address class and binary form, and split the network into smaller subnets. Example: 192.168.1.130/24 is the network 192.168.1.0 with 254 usable hosts.
Show steps
How to use the Subnet Calculator
- Type an IPv4 address, such as 192.168.1.130. You can add the prefix, like 10.0.0.5/20.
- Choose the prefix length from the list if you did not type it.
- Optionally pick how many equal subnets to split the network into.
- Press Calculate to see addresses, masks, hosts and the binary form.
Formula and method
Subnet mask = the first p bits set to 1. Network address = IP AND mask. Wildcard mask = NOT mask. Broadcast = network OR wildcard. Total addresses = 2^(32 – p). Usable hosts = 2^(32 – p) – 2, except /31 (2) and /32 (1). Splitting into 2^n subnets adds n bits to the prefix.
Worked example: 192.168.1.130/24
| Item | Value |
|---|---|
| Mask | 255.255.255.0 |
| Network | 192.168.1.0 |
| Broadcast | 192.168.1.255 |
| Usable range | 192.168.1.1 to 192.168.1.254 |
| Usable hosts | 254 |
CIDR prefix cheat sheet
| Prefix | Subnet mask | Addresses | Usable hosts |
|---|---|---|---|
| /8 | 255.0.0.0 | 16,777,216 | 16,777,214 |
| /16 | 255.255.0.0 | 65,536 | 65,534 |
| /20 | 255.255.240.0 | 4,096 | 4,094 |
| /22 | 255.255.252.0 | 1,024 | 1,022 |
| /23 | 255.255.254.0 | 512 | 510 |
| /24 | 255.255.255.0 | 256 | 254 |
| /25 | 255.255.255.128 | 128 | 126 |
| /26 | 255.255.255.192 | 64 | 62 |
| /27 | 255.255.255.224 | 32 | 30 |
| /28 | 255.255.255.240 | 16 | 14 |
| /29 | 255.255.255.248 | 8 | 6 |
| /30 | 255.255.255.252 | 4 | 2 |
Private IP ranges (RFC 1918)
| Range | CIDR | Addresses |
|---|---|---|
| 10.0.0.0 to 10.255.255.255 | 10.0.0.0/8 | 16,777,216 |
| 172.16.0.0 to 172.31.255.255 | 172.16.0.0/12 | 1,048,576 |
| 192.168.0.0 to 192.168.255.255 | 192.168.0.0/16 | 65,536 |
What subnetting is
Subnetting divides a network into smaller networks to limit broadcast traffic, improve security and make better use of addresses. The prefix length says how many bits identify the network, and the rest identify hosts.
Frequently asked questions
How do I calculate a subnet?
AND the IP address with the subnet mask to get the network address, then OR with the wildcard mask to get the broadcast address.
How many usable hosts are in a /24?
254. A /24 has 256 addresses, minus the network and broadcast addresses.
What is the subnet mask for /26?
255.255.255.192, with 62 usable hosts.
What is a wildcard mask?
The inverse of the subnet mask, used in access lists and routing configuration.
What is CIDR notation?
An address followed by a slash and the prefix length, such as 10.0.0.0/8.
What are private IP addresses?
Addresses reserved for internal networks: 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16.
Sources
Related calculators
Related to This Article
More math articles
- Ecclesia, Church, Denomination, Sect, and New Religious Movement
- Marriage Forms, Boundaries, and Partner Similarity
- The Best Grade 3 Math Book for Florida Students
- Calculating the Surface Area of Prisms and Cylinders
- The Best Calculator for the SAT or ACT
- The Math Behind Fair Play: Exploring Random Number Generators and Statistical Testing
- Chapter 2: The Articles of Confederation
- The Best Grade 3 ELA Practice Tests for Nevada Students
- 3rd Grade CMAS Math Worksheets: FREE & Printable
- ISEE Middle Level Math Formulas


What people say about "Subnet Calculator: IPv4 CIDR, Masks, Hosts, Binary & Subnet Splitting"?
No one replied yet.