Developer

Subnet Calculator

IPv4 network broadcast host ranges from CIDR.

Loading interactive tool…

Embed this tool on your site

About this tool

Subnet Calculator on UtilityKit resolves an IPv4 address and prefix length into its network parameters in your browser. Type an address such as 192.168.1.42 in the IPv4 address field, set the CIDR prefix (0-32), click Calculate, and receive the subnet in CIDR form, the netmask in dotted-decimal, the wildcard mask, the broadcast address, the first and last usable host, and the usable host count, all computed with no server required. If you enter a host address, the Subnet line shows the canonical network, so 192.168.1.50 with prefix 24 becomes 192.168.1.0/24. /31 point-to-point and /32 host routes are handled. The calculator works on one block at a time, which suits checking firewall rules, cloud security group ranges, VPC subnet sizes or CCNA practice answers without manual binary arithmetic and the off-by-one errors it invites.

Why use it

  • Eliminates Binary Arithmetic: Converting CIDR to subnet mask and host ranges by hand requires error-prone binary AND operations. The calculator handles all bit arithmetic instantly and accurately.

  • Cloud & Firewall Ready: AWS VPC, Azure VNET, GCP VPC, and most firewall UIs accept CIDR input directly. Verify your address ranges before entering them to avoid over-permissive or broken rules.

  • Host-Address Correction: Enter any address inside a subnet and the tool reports the true network boundary, catching rules written with a host address where a network address belongs.

  • VLSM Planning: Change the prefix length and recalculate to size subnets for different departments or availability zones without maintaining a spreadsheet.

  • Exam & Study Aid: CCNA, CompTIA Network+, and similar certifications test subnet calculations. This tool lets you check your manual work instantly during practice.

  • Fully Browser-Side: Internal IP addresses and network topologies never leave your device — all computation runs locally with no server round-trip.

How to use

  1. Type an IPv4 address in dotted-decimal into the IPv4 address field, for example 10.0.0.0 or 192.168.100.64, and the prefix length (0-32) into the CIDR field.
  2. Click Calculate. If you entered a host address instead of the network address (e.g. 192.168.1.50 with CIDR 24), the Subnet line shows the canonical network 192.168.1.0/24.
  3. Read the results: Subnet, Netmask, Wildcard, Broadcast, First host, Last host, and Usable hosts.
  4. Note the usable host formula: 2^(32−prefix) − 2, subtracting the network and broadcast addresses. A /30 gives 2 hosts; a /24 gives 254.
  5. For VLSM planning, change the CIDR value and click Calculate again to see how host count and address range change — going from /24 to /25 halves the usable hosts.
  6. Select the result text and copy it into documentation or a network diagram tool.

When it helps

  • When designing a VPC or VNET and you need to confirm that each planned CIDR block provides enough host addresses for its tier.
  • When writing firewall or security group rules and you need the exact network address and mask to avoid accidentally allowing too broad a range.
  • When troubleshooting a routing issue and you need to verify whether a given IP falls within a particular subnet's host range.
  • When documenting a network topology and you need broadcast addresses, wildcard masks, or host counts for every segment.
  • When studying for CCNA, Network+, or similar networking certifications and you want to verify your manual subnet calculations.
  • When migrating an on-premise network to a cloud provider and you need the dotted netmask that matches a given CIDR prefix length.

Examples

Standard /24 LAN subnet

Input
IPv4 address 192.168.1.50, CIDR 24
Expected result
Subnet: 192.168.1.0/24 | Netmask: 255.255.255.0 | Wildcard: 0.0.0.255 | Broadcast: 192.168.1.255 | First host: 192.168.1.1 | Last host: 192.168.1.254 | Usable hosts: 254

Small /30 point-to-point link

Input
IPv4 address 10.0.0.0, CIDR 30
Expected result
Subnet: 10.0.0.0/30 | Netmask: 255.255.255.252 | Wildcard: 0.0.0.3 | Broadcast: 10.0.0.3 | First host: 10.0.0.1 | Last host: 10.0.0.2 | Usable hosts: 2

AWS VPC /16 supernet

Input
IPv4 address 172.31.0.0, CIDR 16
Expected result
Subnet: 172.31.0.0/16 | Netmask: 255.255.0.0 | Wildcard: 0.0.255.255 | Broadcast: 172.31.255.255 | First host: 172.31.0.1 | Last host: 172.31.255.254 | Usable hosts: 65,534

Tips

  • For point-to-point WAN links between two routers, use a /30 (2 usable hosts) to conserve address space instead of wasting a /24 on a two-device link.
  • When planning a three-tier VPC (web, app, database), allocate larger subnets (/23 or /22) to tiers that auto-scale and smaller ones (/27 or /28) to tightly controlled database tiers.
  • The subnet mask in dotted-decimal maps directly to CIDR: 255.255.255.0 = /24, 255.255.255.128 = /25, 255.255.255.192 = /26, 255.255.255.224 = /27.
  • Always leave at least one /16 block unallocated when designing a large-organisation address plan — growth inevitably requires more space than initially estimated.
  • Cross-check your output against RFC 1918 private ranges: if your subnet contains 10.x.x.x, 172.16-31.x.x, or 192.168.x.x addresses, it is non-routable on the public internet and appropriate for internal use only.

Frequently Asked Questions

What is CIDR notation?
Classless Inter-Domain Routing (CIDR) notation expresses an IP address and its network prefix length together, separated by a slash — for example 192.168.1.0/24. The number after the slash indicates how many bits are used for the network portion, with the remaining bits available for host addresses.
Why are two host addresses subtracted from the total?
The first address in any subnet (all host bits zero) is reserved as the network address, and the last address (all host bits one) is the broadcast address. Both are unusable by individual hosts. A /24 has 256 total addresses but only 254 usable hosts.
What is a wildcard mask?
A wildcard mask is the bitwise inverse of the subnet mask. Where the subnet mask has 1s (network bits), the wildcard has 0s, and vice versa. Wildcard masks are used in Cisco ACLs and OSPF configuration to specify which bits of an address must match.
What prefix length gives exactly 30 usable hosts?
A /27 prefix gives 32 total addresses minus 2 = 30 usable hosts. A /26 gives 62, a /28 gives 14. Use the calculator to explore the relationship between prefix length and host count interactively.
Can this calculator handle /31 and /32 prefixes?
Yes. A /31 subnet (RFC 3021) has 2 addresses with no reserved network or broadcast — both are usable for point-to-point links. A /32 is a host route representing exactly one IP address. Both are displayed correctly.
Does the tool support IPv6 subnetting?
This tool is focused on IPv4 CIDR subnetting. For IPv6 address representation and conversion, see the IPv4 to IPv6 Converter tool on UtilityKit.
What is VLSM and how does this tool help?
Variable Length Subnet Masking (VLSM) allows different subnets within the same address space to have different prefix lengths, optimising IP allocation. This tool calculates one block at a time, so you can confirm the size and range of each subnet in a VLSM scheme; it does not compare blocks for overlaps.
Can I enter a dotted mask like 255.255.255.0 or a full CIDR string?
No. The IPv4 address field takes only a dotted-decimal address and the CIDR field takes only the prefix number 0-32. Typing 192.168.1.0/24 or 255.255.255.0 into these fields shows a validation error; the result does display the dotted netmask for the prefix you choose.
What is the largest private IP range I can subnet?
The three RFC 1918 private ranges are 10.0.0.0/8 (16,777,214 hosts), 172.16.0.0/12 (1,048,574 hosts), and 192.168.0.0/16 (65,534 hosts). Enter any of these blocks to see the full address range before dividing it into smaller subnets.

Explore the category

Glossary

CIDR
Classless Inter-Domain Routing — a method for allocating IP addresses using a variable-length prefix instead of the fixed class system (Class A/B/C). Written as address/prefix-length, e.g. 10.0.0.0/8.
Network Address
The first address in a subnet, where all host bits are zero. Identifies the subnet itself and cannot be assigned to any host device.
Broadcast Address
The last address in a subnet, where all host bits are one. Packets sent to this address are delivered to all hosts in the subnet. It cannot be assigned to a host.
Subnet Mask
A 32-bit number that divides an IP address into network and host portions. Written in dotted-decimal (e.g. 255.255.255.0) or as a prefix length after a slash (e.g. /24).
Wildcard Mask
The bitwise inverse of the subnet mask. Used in Cisco ACL and OSPF configurations to specify which bits of an address are significant. A /24 subnet mask of 255.255.255.0 has wildcard mask 0.0.0.255.
VLSM
Variable Length Subnet Masking — the practice of subdividing an address space into subnets of different sizes by using different prefix lengths, allowing efficient allocation of IP addresses across networks with varying host counts.
A LITTLE HELP. A LOT DONE.
Good tools.
Great flow.

Your shortcut to the everyday. Create, convert, calculate,
and get back to what you love.

✓ Free to use✓ No sign-up✓ 500+ possibilities