HCODX/Subnet Calculator
IPv4 · CIDR · full breakdown

Subnet Calculator

Enter any IPv4 address and CIDR prefix (/0 through /32) and get the network address, broadcast, subnet mask, wildcard mask, host range, and totals — all computed locally in your browser.

Subnet input
Subnet breakdown
Prefix
/24
Total addresses
256
Usable hosts
254
Status
Ready
Example

One IP and prefix, full breakdown

Every CIDR collapses to a numeric range. The calculator extracts the network, the broadcast, the mask shape, and where your usable hosts live.

Input
10.0.0.42/22
Output
Network:   10.0.0.0
Broadcast: 10.0.3.255
Mask:      255.255.252.0
Wildcard:  0.0.3.255
First:     10.0.0.1
Last:      10.0.3.254
Hosts:     1022
Use cases

What you'll use this for

From classroom networking labs to designing real production VPCs, the subnet calculator answers the boring-but-critical questions.

VPC & cloud subnetting

Carve up 10.0.0.0/16 into AWS, GCP or Azure subnets without an off-by-one bug.

Router config

Convert between dotted mask and CIDR for IOS, JunOS, MikroTik and Linux iproute2.

Networking exams

Verify CCNA / Network+ practice problems and double-check ACL math.

Firewall rules

Translate a prefix into a wildcard mask for an ACL or compute the broadcast for a NAT rule.

Step by step

How to use the subnet calculator

1

Enter the IPv4 address

Type any dotted-quad address such as 172.16.32.10. The address itself can be a network, host, or broadcast — the prefix decides.

2

Pick a CIDR prefix

Any value from /0 (the whole internet) to /32 (a single host). Common LAN sizes are /24, /27, and /30.

3

Read the breakdown

Network and broadcast addresses, masks, host range, and totals appear instantly. /31 and /32 follow RFC 3021.

4

Copy the result

Click to copy the entire breakdown as plain text — paste it into a doc, a ticket, or a router config.

FAQ

Frequently asked questions

A subnet mask has 1s for the network portion and 0s for the host portion. A wildcard mask is the bitwise inverse — 0s for the network and 1s for the host — and is what Cisco ACLs accept.

RFC 3021 allows /31 networks for point-to-point links, where both addresses are usable because there's no broadcast on a two-node segment. /32 is treated as a single host route.

The broadcast is the network address OR'd with the bitwise inverse of the mask — every host bit set to 1. For 10.0.0.0/22, that's 10.0.3.255.

Each step in prefix doubles the host count. /24 = 256 addresses, /23 = 512, /22 = 1024, and so on. Subtract 2 (network + broadcast) for usable hosts on prefixes /30 and shorter.

This tool focuses on IPv4. For IPv6 prefix math, use our IPv4 to IPv6 converter or follow up with the CIDR Calculator.

About

About IPv4 subnetting

Classless Inter-Domain Routing (RFC 4632) replaced the old class-A/B/C system in 1993 with a single number — the prefix length — that says how many leading bits of the address identify the network. Everything below subnetting comes down to that one slash.

Key terms

  • Network address — first address in the block, all host bits zero.
  • Broadcast address — last address, all host bits set; sends to every host on the segment.
  • Subnet mask — the dotted-quad form of the prefix.
  • Wildcard mask — bitwise inverse of the subnet mask; used by Cisco ACLs.

Common prefix sizes

  • /30 — 4 addresses, 2 usable. Point-to-point links.
  • /29 — 8 addresses, 6 usable. Small subnet for a handful of devices.
  • /24 — 256 addresses, 254 usable. Classic "Class C" LAN.
  • /16 — 65,536 addresses. Often the top-level VPC range.
Related

Related tools