Subnet CIDR Calculator - Free IPv4 Subnet Tool

Subnet / CIDR Calculator

Calculate IPv4 network, broadcast, mask, host range, and binary representation from a CIDR.

This subnet CIDR calculator turns any IPv4 address and prefix length into a full subnet breakdown. Enter something like 192.168.1.10/24 and you get the network address, broadcast address, subnet mask, wildcard mask, usable host range, host counts and address type. It is built for network admins, students and anyone planning IP space.

What Is a Subnet CIDR Block?

A subnet CIDR block is a range of IPv4 addresses written as a starting address plus a prefix length, such as 10.0.0.0/24. CIDR stands for Classless Inter-Domain Routing. The number after the slash tells you how many of the 32 bits identify the network. The remaining bits identify individual hosts inside it.

The prefix fixes the size of the block. The total number of addresses is 2 raised to the power of (32 minus the prefix). A /24 holds 256 addresses, a /26 holds 64 and a /30 holds 4. In an ordinary subnet, the first address is the network address and the last is the broadcast address, so usable hosts equal the total minus 2.

The subnet mask is the same prefix written in dotted decimal, for example /24 is 255.255.255.0. The wildcard mask is the inverse of the subnet mask (0.0.0.255 for a /24), and you will see it in router access lists and routing configuration.

How Do You Calculate a Subnet Mask From a CIDR Prefix?

Write the prefix as that many 1 bits followed by enough 0 bits to reach 32, then convert each group of 8 bits to decimal. For /26, that is 11111111.11111111.11111111.11000000, which is 255.255.255.192. The tool shows this binary form in the Mask (binary) row so you can check the work.

There is also a shortcut. Subtract the changing octet of the mask from 256 to get the block size: 256 minus 192 is 64. Subnets then start at multiples of 64 (0, 64, 128, 192), and any host belongs to the block whose start is the nearest multiple at or below its last octet.

CIDRSubnet maskUsable hosts
/24255.255.255.0254
/25255.255.255.128126
/26255.255.255.19262
/27255.255.255.22430
/28255.255.255.24014
/29255.255.255.2486
/30255.255.255.2522

How to Use the Subnet / CIDR Calculator

You only need an IPv4 address and a prefix length. The page starts with 192.168.1.10/24 filled in, so you can see a result right away.

  1. Type an address with its prefix in the IP / CIDR field, for example 10.0.0.77/26.
  2. If you prefer to enter the address alone, leave off the slash and set the CIDR (if no /N above) box to a whole number from 0 to 32. That box is used only when the first field has no slash.
  3. Read the results table: Network, Broadcast, Subnet Mask, Wildcard Mask, Mask (binary), First Usable Host, Last Usable Host, Total Addresses, Usable Hosts, Class and Type.
  4. Change the prefix up or down to compare block sizes. Moving from /26 to /27 halves the block.
  5. If an error message appears, fix the address or prefix as described in the troubleshooting section below.

Worked Example: 10.0.0.77/26

For 10.0.0.77/26, the calculator reports the subnet that contains that host and every boundary you need. Here is the reasoning behind each value.

  • Mask: /26 gives 255.255.255.192, so the block size in the last octet is 256 minus 192, or 64.
  • Network: 77 falls between 64 and 127, so the network address is 10.0.0.64.
  • Broadcast: the last address in the block is 10.0.0.127.
  • Usable range: 10.0.0.65 to 10.0.0.126.
  • Wildcard mask: 0.0.0.63.
  • Totals: 64 total addresses and 62 usable hosts.
  • Type: Private (RFC 1918), because 10.0.0.0/8 is reserved for private networks.

This tells you the host at 10.0.0.77 shares a subnet with 10.0.0.100 but not with 10.0.0.130, which sits in the next /26. That is the kind of question the tool answers fastest: are these two addresses on the same network?

How Do You Read and Act on the Results?

Each row answers a specific planning or troubleshooting question, and the Type row warns you when an address is not what you assumed.

Network and broadcast

The network address identifies the subnet and is used in routing tables and firewall rules. The broadcast address is the top of the range. Do not assign either to a device in a standard subnet. If your input was a host address like 10.0.0.77, the network row shows the true subnet start, which often differs from what you typed.

First and last usable host

These two rows are the range you can assign to devices, gateways and DHCP pools. A common habit is to give the router the first usable address and keep a few at the end for static devices.

Total addresses and usable hosts

Compare Usable Hosts with the number of devices you need, plus growth. If you need 40 devices, a /26 with 62 usable hosts fits, while a /27 with 30 does not. Leaving 25 to 30 percent headroom is a common planning habit, not a rule.

Wildcard mask

Use the wildcard mask when a platform asks for it instead of a subnet mask, as in many router access lists and OSPF network statements. A 0 bit means the bit must match and a 1 bit means any value is accepted.

Class

The Class row (A, B, C, D or E) comes from the first octet and describes the old classful system. Modern networks use CIDR, so treat the class as background information. It does not limit the prefix you can use.

Type

The Type row labels the address as Private (RFC 1918), Loopback, Link-local, Shared address space (CGNAT), Documentation, Benchmarking, Multicast, Reserved / special use, or Public address space (routing not verified). A public label only means the address is not in a special range. It does not confirm the address is routed or owned by you. To find who announces a public range, try an ASN lookup.

/31 and /32 results

A /31 shows 2 usable hosts and a /32 shows 1. The tool treats a /31 as a point-to-point link where both addresses are usable, as described in RFC 3021, and a /32 as a single host route.

Who Is This Subnet Calculator For?

It helps anyone who needs to size, check or document an IPv4 block without doing binary math by hand.

  • Network admins: carve a /24 into smaller segments for VLANs, servers and guest Wi-Fi, and confirm each gateway sits inside its range.
  • Cloud engineers: check that a VPC or virtual network range such as 172.16.0.0/16 leaves room for the subnets you plan.
  • Students: verify exam practice answers and compare your binary work with the Mask (binary) row.
  • Developers and sysadmins: confirm whether two addresses are on the same subnet before writing firewall or allowlist rules. If you only need the start and end of a block, the CIDR to IP range converter gives a focused view.
  • SEO and hosting teams: understand the ranges behind shared hosting, then compare them using a Class C IP checker when reviewing link or site neighborhoods.

Best Practices, Common Mistakes and Troubleshooting

Most wrong answers come from input mistakes or from misreading a host address as a network address.

  • Message says Invalid IPv4 address or Invalid octet: an IPv4 address needs exactly four numbers from 0 to 255 separated by dots. Values like 192.168.1 or 300.1.1.1 will fail.
  • Message says to use IPv4/prefix: use a single slash followed by a whole number, such as /24. Entries like 192.168.1.0/255.255.255.0 or 10.0.0.0/24/8 are not accepted. Convert the mask to a prefix first.
  • Message says CIDR must be 0 to 32: IPv4 has 32 bits, so /33 and above cannot exist. Decimals and negative numbers are also rejected.
  • The network address is not the one you typed: that is expected when you enter a host address. The tool applies the mask and shows the real network start.
  • The CIDR box seems ignored: it is used only when the main field has no slash. Remove the slash from the main field to use it.
  • Plan on boundaries: a subnet must start on a multiple of its block size. A /26 cannot start at 10.0.0.10, only at 0, 64, 128 or 192.
  • Document your plan: keep a table of each subnet, its gateway and its purpose, and check each row here before you deploy it.

Limitations to Know About

This tool works with IPv4 only and calculates one subnet at a time. For 128-bit addresses, use the IPv6 subnet calculator instead. It does not split a block into several subnets automatically, so for VLSM planning you work through your segments from largest to smallest and check each one here.

The Type row is based on well-known special-purpose ranges, not live routing data. To see which IP a domain actually uses, run it through a domain to IP lookup. More utilities for addressing and DNS are collected in the Network & IP tools hub.

Enter your address and prefix in the fields above to get the network, mask, host range and counts in one table. Adjust the prefix until the usable host count fits your design, then copy the values into your configuration.

Frequently Asked Questions

What is a subnet CIDR block?
A subnet CIDR block is a range of IPv4 addresses written as an address plus a prefix length, like 192.168.1.0/24. The prefix says how many of the 32 bits identify the network. A /24 contains 256 addresses, and 254 of them are usable for hosts.
How do I calculate a subnet mask from a CIDR prefix?
Write the prefix as that many 1 bits, fill the rest of the 32 bits with 0s, then convert each 8-bit group to decimal. A /26 becomes 255.255.255.192. Enter the prefix in the calculator to see the mask and its binary form.
Can I enter an IP address without a slash?
Yes. Type the address alone in the IP / CIDR field and set the separate CIDR box to a whole number from 0 to 32. That box is only used when the main field has no slash. The default is 24.
Why do /31 and /32 show different usable host counts?
A /31 shows 2 usable hosts because it is treated as a point-to-point link where both addresses work, per RFC 3021. A /32 shows 1 because it is a single host route with no separate network or broadcast address.
Does this subnet calculator support IPv6 or VLSM?
It supports IPv4 only, and it calculates one subnet at a time, with no sign-in needed. For VLSM, check each segment separately, largest first. IPv6 needs a dedicated IPv6 subnet calculator because its addresses are 128 bits long.
Why does the calculator show an invalid address or CIDR error?
The input does not meet IPv4 rules. You need four numbers from 0 to 255 separated by dots, and a whole-number prefix from 0 to 32. Entries like 192.168.1, 10.0.0.0/33 or a dotted mask after the slash will fail. Correct the value and the table refreshes.
Recommended

Explore VPN options

A VPN changes your network exit. It does not guarantee anonymity.

Hide Your IP Encryption Network coverage
Protect My IP Now

IPv4 ranges

Calculates IPv4 network ranges from a strict address and prefix. Private, loopback, documentation, carrier-grade NAT and other special-use ranges have separate labels. A public-range address is not proof of Internet reachability.

Implementation reviewed: 4 October 2026. Source documentation