EN
My tools

Subnet Mask Calculator

Find the subnet mask for the hosts or subnets you need, convert CIDR to dotted mask and back, and get the wildcard mask. Full /0–/32 reference table.

For "Hosts needed" mode.
For "Number of subnets" mode.
For "Prefix length" mode.
For "Dotted subnet mask" mode.
For "Wildcard mask" mode.
Prefix length
/26
Subnet mask
255.255.255.192
Wildcard mask
0.0.0.63
Usable hosts per subnet
62
network and broadcast excluded
Addresses per subnet
64
Spare host addresses
12
Binary mask
11111111.11111111.11111111.11000000
Hex mask
0xFFFFFFC0
IPv4 prefix reference (/0–/32)
PrefixSubnet maskWildcardAddressesUsable hosts
/00.0.0.0255.255.255.2554,294,967,2964,294,967,294
/1128.0.0.0127.255.255.2552,147,483,6482,147,483,646
/2192.0.0.063.255.255.2551,073,741,8241,073,741,822
/3224.0.0.031.255.255.255536,870,912536,870,910
/4240.0.0.015.255.255.255268,435,456268,435,454
/5248.0.0.07.255.255.255134,217,728134,217,726
/6252.0.0.03.255.255.25567,108,86467,108,862
/7254.0.0.01.255.255.25533,554,43233,554,430
/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
My tools →
Advertisement

The subnet mask decides how many addresses a network holds. This calculator answers the questions that come up when planning one: which mask fits 50 hosts, how small subnets get when a /24 is cut into five, what /20 looks like in dotted form, and which prefix a mask or wildcard mask such as 0.0.15.255 stands for. A full /0–/32 table is included for quick reference.

How to use this tool

  1. Pick what you know: hosts needed, subnets needed, a prefix, a dotted mask or a wildcard mask.
  2. Enter that value in its field (the other fields are ignored).
  3. Read the prefix, dotted mask, wildcard mask and host count.
  4. Use the reference table to compare neighbouring sizes.

Formula

usable hosts = 2^(32 − p) − 2 · smallest p with 2^(32 − p) − 2 ≥ hosts · new p = base p + ⌈log₂ subnets⌉

p is the prefix length (the number of 1-bits in the mask). A valid mask has all its 1-bits on the left; the wildcard mask is the same mask with every bit inverted, as used in Cisco ACLs and OSPF.

Example

You need 50 hosts on a LAN. A /27 holds 32 − 2 = 30 hosts, too few; a /26 holds 64 − 2 = 62, so the mask is 255.255.255.192 (/26) with wildcard 0.0.0.63, leaving 12 spare addresses. Dividing a /24 into 5 subnets needs 3 extra bits (2³ = 8 ≥ 5), giving /27 subnets of 30 hosts each.

Frequently asked questions

Why is 255.0.255.0 rejected?

Subnet masks must be contiguous: once a 0-bit appears, every bit after it is 0. 255.0.255.0 has 1-bits after 0-bits, so no prefix length matches it.

How many hosts does a /24 hold?

256 addresses, of which 254 can be assigned to hosts, because the first is the network address and the last the broadcast address.

When should I use /31?

On links between exactly two routers. RFC 3021 allows both addresses of a /31 to be used, which saves two addresses compared with a /30.

Sources

Last updated:

Cite or embed this tool
APA

kakaoCalc. (2026, November 8). Subnet Mask Calculator. https://kakao.mobile/tools/subnet-mask-calculator/

MLA

“Subnet Mask Calculator.” kakaoCalc, 8 Nov. 2026, kakao.mobile/tools/subnet-mask-calculator/.

Paste this code into your page. The widget runs in your visitors' browsers, shows no ads and keeps a link back to this page. Embedding terms

Advertisement