Development

Subnet Calculator

Calculate an IPv4 subnet from CIDR notation or a mask: network and broadcast addresses, usable host range, host count, wildcard mask, binary view, and subnet splitting.

IPv4 Subnet Calculator
Enter an address in CIDR notation (10.0.0.5/16), with a mask (10.0.0.5 255.255.0.0), or pick the mask below.
Network
Network address
192.168.1.0
CIDR
192.168.1.0/24
Broadcast address
192.168.1.255
Usable host range
192.168.1.1 – 192.168.1.254
Usable hosts
254
Total addresses
256
Mask and address
Subnet mask
255.255.255.0
Wildcard mask
0.0.0.255
Prefix length
/24
IP address
192.168.1.10
Hex
0xC0A8010A
Integer
3232235786
Class C
Private (RFC 1918)
Binary
Network bits and host bits.
Address11000000.10101000.00000001.00001010
Mask11111111.11111111.11111111.00000000
Network11000000.10101000.00000001.00000000
Broadcast11000000.10101000.00000001.11111111
Split into subnets
Divide 192.168.1.0/24 into smaller, equal blocks.

About this tool

The Subnet Calculator works out everything about an IPv4 network as you type. Enter an address in CIDR notation, like 10.0.0.5/16, with a dotted subnet mask, or pick the mask from the list, and see the network address, broadcast address, first and last usable host, number of usable hosts and total addresses, subnet mask, wildcard mask, and the address in hex and as an integer. It labels the address class and whether it is private, public, loopback, link-local, carrier-grade NAT or reserved, and a binary view shows exactly which bits belong to the network and which to hosts. Need smaller networks? Split the block into equal subnets of any size and get a table of every network, usable range and broadcast address. /31 point-to-point links and /32 single hosts are handled correctly, and everything is calculated in your browser.

How to use the Subnet Calculator

  1. Type an IPv4 address with a prefix, like 192.168.1.10/24, or with a mask, like 192.168.1.10 255.255.255.0.
  2. Or type just the address and pick the subnet mask from the list.
  3. Read the network, broadcast, usable host range and host counts, and copy any value with its copy button.
  4. Check the binary view to see the network bits and host bits.
  5. To divide the network, choose a size under Split into subnets.

Use it from your code

The Subnet Calculator is also a REST API endpoint. Create a free API key and call it from your own scripts and apps.

# GET
curl -G https://opentools.ca/api/v1/tools/subnet-calculator \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --data-urlencode "address=192.168.1.10/24"

# POST, split into /26 subnets
curl -X POST https://opentools.ca/api/v1/tools/subnet-calculator \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"address": "192.168.1.10/24", "splitPrefix": 26}'

Give us your feedback

Help us improve Subnet Calculator!

Frequently asked questions

Why are there two fewer usable hosts than addresses?

In a normal subnet the first address identifies the network and the last is the broadcast address, so neither can be given to a device. A /24 has 256 addresses and 254 usable hosts.

What about /31 and /32?

A /31 has only two addresses and is used for point-to-point links (RFC 3021), so both are usable. A /32 is a single host address, often used for loopbacks and firewall rules.

What is a wildcard mask?

It is the subnet mask with every bit flipped, so 255.255.255.0 becomes 0.0.0.255. Cisco access lists and OSPF use wildcard masks to say which bits of an address to ignore.

Which addresses are private?

10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 are private (RFC 1918) and are not routed on the internet. The calculator also flags loopback, link-local, carrier-grade NAT, documentation and multicast ranges.

Does it support IPv6?

Not yet. This calculator covers IPv4 subnets.

Subnet Calculator screenshot