Skip to content

Enter an IP address with a prefix or subnet mask to get its network, broadcast and host range. IPv4 and IPv6.

IP address
192.168.1.10
Network address
192.168.1.0/24
Subnet mask
255.255.255.0
Wildcard mask
0.0.0.255
Broadcast address
192.168.1.255
First usable host
192.168.1.1
Last usable host
192.168.1.254
Usable hosts
254
Total addresses
256
Address type
Private (RFC 1918)
IP class
C
Hex
0xC0A8010A
Integer
3232235786
Reverse DNS (PTR)
10.1.168.192.in-addr.arpa

Binary. The first 24 bits are the network, the remaining 8 identify the host.

Address11000000.10101000.00000001.00001010Mask11111111.11111111.11111111.00000000
Ctrl+Shift+CCopy all resultsAccepts a prefix (/24), a subnet mask (255.255.255.0) or a Cisco wildcard mask (0.0.0.255).

Share this tool

Found it useful? Help a fellow developer discover it.

https://developertoolkit.dev/tools/subnet-calculator

How the subnet calculator works

An IPv4 address is 32 bits. A subnet mask splits those bits in two: the bits under the 1s of the mask name the network, and the bits under the 0s name a host on that network. In 192.168.1.10/24, the /24 means the first 24 bits are the network, which is the same as the mask 255.255.255.0. That leaves 8 host bits, or 256 addresses from 192.168.1.0 to 192.168.1.255.

The subnet calculator does that bit math for you. The network address is the IP with every host bit set to 0, and the broadcast address is the IP with every host bit set to 1. Neither can be given to a device, so a /24 has 254 usable hosts. The wildcard mask is the subnet mask inverted, the form Cisco ACLs and OSPF network statements expect. Type a mask such as 10.0.0.1 255.255.240.0 instead of a prefix and the calculator converts it, and it reads IPv6 addresses like 2001:db8::/48 as well.

Subnet mask cheat sheet

Every IPv4 prefix from /8 to /32 with its subnet mask, wildcard mask and size. Each step down halves the number of addresses.

CIDRSubnet maskWildcard maskAddressesUsable hosts
/8255.0.0.00.255.255.25516,777,21616,777,214
/9255.128.0.00.127.255.2558,388,6088,388,606
/10255.192.0.00.63.255.2554,194,3044,194,302
/11255.224.0.00.31.255.2552,097,1522,097,150
/12255.240.0.00.15.255.2551,048,5761,048,574
/13255.248.0.00.7.255.255524,288524,286
/14255.252.0.00.3.255.255262,144262,142
/15255.254.0.00.1.255.255131,072131,070
/16255.255.0.00.0.255.25565,53665,534
/17255.255.128.00.0.127.25532,76832,766
/18255.255.192.00.0.63.25516,38416,382
/19255.255.224.00.0.31.2558,1928,190
/20255.255.240.00.0.15.2554,0964,094
/21255.255.248.00.0.7.2552,0482,046
/22255.255.252.00.0.3.2551,0241,022
/23255.255.254.00.0.1.255512510
/24255.255.255.00.0.0.255256254
/25255.255.255.1280.0.0.127128126
/26255.255.255.1920.0.0.636462
/27255.255.255.2240.0.0.313230
/28255.255.255.2400.0.0.151614
/29255.255.255.2480.0.0.786
/30255.255.255.2520.0.0.342
/31255.255.255.2540.0.0.122
/32255.255.255.2550.0.0.011

Private and reserved IPv4 ranges

These ranges are never routed on the public internet. The calculator labels any address that falls in one of them.

RangeAddressesUsed for
10.0.0.0/816,777,216Large private networks, cloud VPCs
172.16.0.0/121,048,576Private networks, Docker's default bridge pool
192.168.0.0/1665,536Home and small office routers
100.64.0.0/104,194,304Carrier-grade NAT, Tailscale
169.254.0.0/1665,536Link-local, self-assigned when DHCP fails
127.0.0.0/816,777,216Loopback (localhost)

How to use

  1. Type an address with its prefix, like 10.20.30.40/20, or with a subnet mask, like 10.20.30.40 255.255.240.0.
  2. Or type just the address and pick the prefix from the list. The list shows the matching subnet mask for each prefix.
  3. Read the network, broadcast and host range from the results. Click Copy on any row, or Copy All for the whole set.
  4. To plan smaller networks, choose a size under Split into. The table lists every subnet with its host range, and Copy list copies the CIDR blocks one per line.

Frequently Asked Questions

How do I calculate a subnet mask from a prefix?

Write the prefix length as that many 1 bits followed by 0 bits up to 32, then read each group of 8 bits as a number. /26 is 11111111.11111111.11111111.11000000, which is 255.255.255.192. The cheat sheet above lists every mask from /8 to /32.

How many usable hosts are in a /24?

254. A /24 has 256 addresses, and the first (the network address) and the last (the broadcast address) cannot be assigned to devices. In general a subnet has 2^(32 − prefix) − 2 usable hosts. The exceptions are /31, where both addresses are usable on a point-to-point link, and /32, which is a single host.

What is CIDR notation?

CIDR (Classless Inter-Domain Routing) writes a network as an address followed by a slash and the number of network bits, as in 10.0.0.0/8. It replaced the old class A, B and C system in 1993, so a network can be any size that is a power of two rather than only /8, /16 or /24.

What is a wildcard mask?

A subnet mask with every bit flipped. The wildcard for 255.255.255.0 is 0.0.0.255. Cisco access lists and OSPF network statements use wildcard masks, where a 0 bit means "must match" and a 1 bit means "any value". You can type a wildcard mask into the calculator and it will work out the prefix.

How do I split a network into smaller subnets?

Each extra prefix bit halves the subnet and doubles the count. A /24 splits into two /25s, four /26s or eight /27s. Pick the size under "Split into" and the calculator lists every subnet with its host range and broadcast address, ready to copy into a plan or an IaC file.

Does it work with IPv6?

Yes. Enter an address such as 2001:db8:abcd::/48 to get the network, the first and last address, and how many /64 subnets it holds. IPv6 has no broadcast address, and a /64 is the standard size for a single LAN, so a /48 site allocation gives you 65,536 of them.

Related Tools