IPv4 Subnet Calculator — CIDR, Mask, Host Range

Compute network address, broadcast, mask, wildcard, and usable host range from any CIDR. Includes binary mask view.

Network address
192.168.1.0
Broadcast address
192.168.1.255
Subnet mask
255.255.255.0
Wildcard mask
0.0.0.255
First usable host
192.168.1.1
Last usable host
192.168.1.254
CIDR prefix
/24
Hosts
254 usable / 256 total
11111111.11111111.11111111.00000000
11000000.10101000.00000001.00000000
network24 bitshost8 bits
About Subnet Calculator

Enter an IPv4 CIDR like 192.168.1.0/24 and get the network address, broadcast, subnet mask in dotted decimal and binary, wildcard mask, first and last usable host, and total host counts. A binary view highlights network bits in sky and host bits in muted, so the prefix boundary is visible at a glance.

Subnetting is one of those skills you either use weekly or rederive from first principles every six months. This calculator covers the common questions. Given a CIDR block, what is the network address? The broadcast? The subnet mask in dotted decimal and in binary? What are the first and last usable host addresses, and how many hosts fit in total? The results let you lay out a VPC, configure a firewall rule, or verify that a new subnet does not overlap with an existing one.

Internally the tool parses the four octets plus the prefix length, converts the address and mask to 32-bit unsigned integers, and does the math with bitwise AND, OR, and NOT operators. /31 and /32 are special-cased: a /31 has two addresses and no separate broadcast (RFC 3021), and a /32 is a single host. The binary view renders each bit individually, coloring the first N bits (where N is the prefix) in sky to indicate the network portion and the rest in muted for the host portion. That makes it visually obvious why a /24 covers 256 addresses while a /16 covers 65,536.

How to use the Subnet Calculator
  1. 1

    Enter a CIDR

    Type something like 10.0.0.0/16 or 192.168.1.0/24. The tool validates the four octets and the prefix length before parsing.

  2. 2

    Review the derived values

    See network address, broadcast, subnet mask in both dotted decimal and binary, wildcard mask, first and last usable host, total hosts, and usable hosts.

  3. 3

    Read the bit breakdown

    The binary view highlights network bits in sky and host bits in muted so you can see the prefix boundary directly.

Common use cases

Plan VPC or VLAN ranges

Size a subnet for a team or environment and confirm it holds enough hosts without wasting address space.

Write firewall rules

Confirm exactly which IPs a CIDR covers before allowing or denying the range in a security group.

Teach or learn subnetting

See the bit-level relationship between prefix length and host count without drawing a truth table by hand.

Check for overlaps

Verify a new block fits inside or alongside an existing one by comparing network and broadcast addresses.

Frequently asked questions
How are usable hosts calculated?

For /0 through /30, usable hosts equal total addresses minus 2 (network and broadcast). /31 has 2 usable addresses per RFC 3021 point-to-point conventions. /32 represents a single host.

Does it support IPv6?

Not in this tool. IPv6 addressing has a different structure and much larger address space. A dedicated IPv6 calculator is a better fit for those use cases.

What is the wildcard mask?

The bitwise inverse of the subnet mask. It is the form used by Cisco ACLs and some firewall syntaxes, where a 1 bit means the position can vary.

Why does /31 show two usable hosts?

RFC 3021 permits /31 subnets on point-to-point links where both addresses are assigned to interfaces rather than reserving one for network and one for broadcast.

Is my input sent to a server?

No. Parsing and subnet math run entirely in your browser. Nothing is transmitted.

webdeveloperconverter