Skip to main content

Subnet Calculator

IPv4 subnet calculator: enter an IP and CIDR prefix to get subnet mask, wildcard mask, network, broadcast, usable range and host count. In your browser.

Whether you are carving a VPC into public and private subnets, writing a firewall rule, or trying to work out why two networks overlap, you need the same handful of numbers: mask, network address, broadcast, usable range and host count. This calculator produces all of them from an IP address and prefix length, with a slider for quick what-if comparisons and a CIDR reference table for the sizes you use most.

Subnet Calculator
CIDR notation192.168.1.0/24
Subnet mask255.255.255.0
Wildcard mask0.0.0.255
Network address192.168.1.0
Broadcast address192.168.1.255
Usable IP range192.168.1.1 - 192.168.1.254
Usable hosts254
IP classC
Binary11000000.10101000.00000001.00000000
Private IPYes

// Subnet Calculator: Features

How many hosts does a /24 or a /29 actually give you?

How many addresses does 10.0.0.0/16 give a VPC? What exact range does allowing 192.168.1.0/24 open on the firewall? Is 172.20.5.9 inside 172.16.0.0/12? How much smaller is a /29 than a /28? These questions come up constantly in network design, cloud architecture and incident response, and the answers depend on bit arithmetic that is easy to get wrong under pressure. Enter the address and prefix and the calculator does the arithmetic for you.

What gets calculated

For any IPv4 address and prefix from /0 to /32 the tool shows the CIDR notation, subnet mask in dotted decimal (for example 255.255.255.0), wildcard mask (the inverted mask used in Cisco ACLs), network address, broadcast address, usable IP range, number of usable hosts, the address class (A through E) and whether the address falls inside an RFC 1918 private range. The full 32-bit binary representation is shown as well, which is handy when you are teaching or learning how masks work. Click any row to copy its value.

CIDR notation in one minute

CIDR writes a network as an address followed by a slash and a prefix length, such as 192.168.1.0/24. The prefix is the number of leading bits that identify the network; the remaining bits identify hosts. A /24 corresponds to mask 255.255.255.0 and contains 256 addresses, of which 254 are usable. Every time the prefix shrinks by one the block doubles: /23 holds 512 addresses, /16 holds 65,536 and /8 holds about 16.7 million. The built-in reference table lists prefix, mask and host count side by side for quick lookup.

Special cases: /31 and /32

The calculator follows RFC 3021 for /31 networks, reporting 2 usable addresses with no separate network or broadcast address, which is how point-to-point router links are configured. A /32 identifies a single host and is reported as 1 usable address, the form you use in firewall rules that allow exactly one IP. For all other prefixes the usable host count is the block size minus two, reflecting the reserved network and broadcast addresses.

Internal address plans never leave the page

All calculations are performed in your browser with plain integer arithmetic. The addresses you type and the ranges you compute are never transmitted, so it is safe to plan internal address space, production VPCs and VPN ranges here. Once the ranges are settled, the Mermaid Preview renders the network diagram that goes with them without sending the topology anywhere either.

// Subnet Calculator: FAQ

What does the /24 in a CIDR address mean?

The number after the slash is the prefix length, the count of leading bits that belong to the network portion of the address. A /24 means 24 network bits and 8 host bits, equivalent to the mask 255.255.255.0. That yields 256 addresses per subnet, with 254 usable for hosts after the network and broadcast addresses are set aside. It is the most common size for office LANs and cloud subnets.

How many hosts fit in a /16, /24, /28 or /29?

A /16 (255.255.0.0) provides 65,534 usable hosts and is a common VPC size. A /24 (255.255.255.0) provides 254, the standard LAN segment. A /28 (255.255.255.240) provides 14 and a /29 (255.255.255.248) provides 6, sizes typical for small cloud subnets and DMZs. Each additional prefix bit halves the number of addresses.

What are the network and broadcast addresses?

The network address is the first address in the block, where all host bits are zero; it identifies the subnet itself in routing tables. The broadcast address is the last address, where all host bits are one; packets sent to it reach every host in the subnet. Neither can be assigned to a device, which is why a /24 offers 254 hosts rather than 256.

Can I use this to plan AWS, Azure or GCP subnets?

Yes, that is one of its main uses. A typical design starts with a /16 VPC such as 10.0.0.0/16 and slices it into /24 or /20 subnets per availability zone and tier. Enter the VPC CIDR to confirm the total address space, then enter each proposed subnet to check its range and make sure the blocks do not overlap. Remember that AWS reserves five addresses per subnet, so the usable count in the console will be slightly lower than the pure arithmetic shown here.

What are private IP ranges (10.x, 172.16.x, 192.168.x)?

RFC 1918 reserves three blocks that are never routed on the public internet: 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. Organizations use them freely inside offices, home networks, VPNs and cloud VPCs, and the same ranges can be reused by different networks without conflict. The calculator flags whether the address you entered falls into one of these ranges.

What is a wildcard mask used for?

A wildcard mask is the bitwise inverse of the subnet mask. Cisco IOS access control lists and OSPF network statements use it instead of a regular mask: the ACL entry permit 192.168.1.0 0.0.0.255 matches the whole /24. The tool shows both masks so you can paste the right one directly into device configuration.

How does the calculator handle /31 and /32?

A /31 is treated according to RFC 3021 as a point-to-point link with 2 usable addresses and no dedicated broadcast address. A /32 is a single host with 1 usable address, the notation used for host routes and one-IP firewall rules. Both are calculated correctly and displayed like any other prefix.

Does it support IPv6?

Not currently. IPv6 uses 128-bit hexadecimal addresses and different subnetting conventions, and this calculator is dedicated to IPv4. If you need to work with IPv6 prefixes, use a dedicated IPv6 subnet tool.

I need to set file permissions on the server after configuring the network. Is there a related tool?

Yes. Once the subnet and firewall rules are in place, the chmod Calculator helps you set correct permissions on configuration files and SSH keys, and the Cron Expression Parser helps you schedule maintenance jobs on the same hosts.

Is any data sent to a server?

No. Every calculation runs in your browser using client-side JavaScript. IP addresses, prefixes and results stay on your machine, making the tool safe for confidential network designs and production address plans.

// How to Use Subnet Calculator

  1. Enter an IP address

    Type any IPv4 address, for example 192.168.1.0 or 10.0.5.17. You can enter the network address, a host address or the broadcast address; the calculator determines the subnet the address belongs to either way.

  2. Set the prefix length

    Choose the CIDR prefix from /0 to /32 with the slider, the number box or the preset buttons for /8, /16, /24, /25, /26, /27, /28, /30 and /32. Results update as you move the slider, which makes it easy to compare sizes.

  3. Read or copy the results

    Review the subnet mask, wildcard mask, network and broadcast addresses, usable range and host count. Click any row to copy its value, and open the CIDR reference table if you want to see the full list of prefix sizes at a glance.

Category Network