Skip to main content
CalcChef

Subnet Mask Calculator

Subnet calculator for IPv4: enter an address and a mask or prefix such as /24 to get the network, broadcast address, host range, usable hosts and wildcard mask. How it works

Use the Subnet Mask Calculator

IPv4 only. Also takes CIDR notation such as 10.0.0.0/8.

Dotted decimal (255.255.255.0), a prefix (/24) or a wildcard mask (0.0.0.255).

Enter a host count, such as 52, to find the smallest mask that fits.

Usable hosts
254
Network Address192.168.1.0
Broadcast Address192.168.1.255
Subnet Mask255.255.255.0
Wildcard Mask0.0.0.255
Prefix Length/24
Total Addresses256
First Usable Host192.168.1.1
Last Usable Host192.168.1.254
Usable IP Range192.168.1.1 – 192.168.1.254

Address range: 192.168.1.10 is in 192.168.0.0/16, Private-Use (RFC 1918), from the IANA IPv4 Special-Purpose Address Registry.

Host Count Formula

2^(32 − 24) − 2 = 256 − 2

= 254 usable hosts

Binary Bit Breakdown
IP Address192.168.1.10
1N1N0N0N0N0N0N0N
1N0N1N0N1N0N0N0N
0N0N0N0N0N0N0N1N
0H0H0H0H1H0H1H0H
Subnet Mask255.255.255.0
1N1N1N1N1N1N1N1N
1N1N1N1N1N1N1N1N
1N1N1N1N1N1N1N1N
0H0H0H0H0H0H0H0H
Network Address192.168.1.0
1N1N0N0N0N0N0N0N
1N0N1N0N1N0N0N0N
0N0N0N0N0N0N0N1N
0H0H0H0H0H0H0H0H

N = network bit (24), H = host bit (8). Network bits are filled, host bits are outlined.

Split this network into equal subnets
Subnets of each longer prefix inside this /24 block
PrefixMaskSubnetsAddresses eachUsable each
/25255.255.255.1282128126
/26255.255.255.19246462
/27255.255.255.22483230
/28255.255.255.240161614
/29255.255.255.2483286
/30255.255.255.2526442
/31255.255.255.25412822
/32255.255.255.25525611

About the Subnet Mask Calculator

A /24 subnet (mask 255.255.255.0) has 256 addresses and 254 usable hosts. For 192.168.1.10/24 the network address is 192.168.1.0, the broadcast address is 192.168.1.255 and hosts run from 192.168.1.1 to 192.168.1.254. This subnet calculator does the same for any IPv4 address with a mask, prefix or wildcard mask, or for CIDR notation such as 10.0.0.0/8 typed in the address field. Given a host count instead, it names the smallest mask that fits.

Subnet masks by prefix length, /8 to /32

PrefixSubnet maskWildcard maskTotal addressesUsable 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

Usable hosts = total addresses − 2, except /31 (2 hosts on a point-to-point link, RFC 3021) and /32 (a single host).

Special-purpose IPv4 blocks the calculator labels

BlockAddress rangeLabel shownRFC
10.0.0.0/810.0.0.0 to 10.255.255.255Private-UseRFC 1918
172.16.0.0/12172.16.0.0 to 172.31.255.255Private-UseRFC 1918
192.168.0.0/16192.168.0.0 to 192.168.255.255Private-UseRFC 1918
100.64.0.0/10100.64.0.0 to 100.127.255.255Shared Address SpaceRFC 6598
127.0.0.0/8127.0.0.0 to 127.255.255.255LoopbackRFC 1122
169.254.0.0/16169.254.0.0 to 169.254.255.255Link LocalRFC 3927
192.0.2.0/24192.0.2.0 to 192.0.2.255Documentation (TEST-NET-1)RFC 5737
198.51.100.0/24198.51.100.0 to 198.51.100.255Documentation (TEST-NET-2)RFC 5737
203.0.113.0/24203.0.113.0 to 203.0.113.255Documentation (TEST-NET-3)RFC 5737
198.18.0.0/15198.18.0.0 to 198.19.255.255BenchmarkingRFC 2544
240.0.0.0/4240.0.0.0 to 255.255.255.255ReservedRFC 1112

Taken from the IANA IPv4 Special-Purpose Address Registry, last updated 2025-10-09. The registry has more entries than these, and the calculator checks an address against all of them. The first three rows are the private ranges. The label is the registry's name for the block; 100.64.0.0/10 is used for carrier-grade NAT, which the calculator says beside the label.

Frequently asked questions

What is the subnet mask for /24?
255.255.255.0. A /24 has 256 addresses and 254 usable hosts. /25 is 255.255.255.128 with 126 hosts, /26 is 255.255.255.192 with 62, and /16 is 255.255.0.0 with 65,534.
How many usable hosts are in a subnet?
2^(32 − prefix) − 2, because the network and broadcast addresses cannot be given to hosts. A /27 has 32 addresses and 30 hosts, and a /30 has 4 addresses and 2 hosts. To go the other way, type a count in Hosts needed: 52 hosts need a /26 (255.255.255.192, wildcard 0.0.0.63, 62 usable), and 14 hosts fit a /28 exactly.
How do I find the network and broadcast address?
AND the address with the mask to get the network, then set every host bit to 1 for the broadcast. 10.20.30.40 with /27 is in network 10.20.30.32, with broadcast 10.20.30.63 and hosts 10.20.30.33 to 10.20.30.62.
How do I split a /24 into smaller subnets?
Each extra prefix bit halves the block. A /24 splits into 2 subnets of /25 (126 hosts each), 4 of /26 (62 each), 8 of /27 (30 each) or 16 of /28 (14 each). The split table under the result lists these for whatever prefix you enter.
Why does a /31 show two usable hosts?
RFC 3021 allows a 31-bit prefix on point-to-point links, where both addresses are read as host addresses and there is no network or broadcast address. 192.168.1.10/31 covers 192.168.1.10 and 192.168.1.11. A /32 is one host address.
Is 172.32.0.1 a private IP address?
No. The private 172 block is 172.16.0.0/12, which ends at 172.31.255.255, so 172.31.255.1 is private and 172.32.0.1 is not. The other two RFC 1918 ranges are 10.0.0.0/8 and 192.168.0.0/16. Under the result the calculator names the registry block an address is in, or says it is in none.

Related Tools

View all tools