Subnet Mask Cheat Sheet
Every subnet mask on one page — search it, apply it to an address, print it.
Subnet mask cheat sheet — IPv4 /0–/32 and common IPv6 prefixes (MySmartCoPilot)
Select a prefix in the table to see its details and apply it to an address.
/24
IPv4 subnet masks, /0 to /32
33 prefixesThe table is wider than the screen: scroll it sideways for the wildcard, hex and binary masks.
| Prefix | Subnet mask | Addresses | Usable hosts | /24s | Wildcard | Hex | Binary |
|---|---|---|---|---|---|---|---|
| 0.0.0.0 | 4,294,967,296 | 4,294,967,294 | 16,777,216 | 255.255.255.255 | 0x00000000 | 00000000.00000000.00000000.00000000 | |
| 128.0.0.0 | 2,147,483,648 | 2,147,483,646 | 8,388,608 | 127.255.255.255 | 0x80000000 | 10000000.00000000.00000000.00000000 | |
| 192.0.0.0 | 1,073,741,824 | 1,073,741,822 | 4,194,304 | 63.255.255.255 | 0xc0000000 | 11000000.00000000.00000000.00000000 | |
| 224.0.0.0 | 536,870,912 | 536,870,910 | 2,097,152 | 31.255.255.255 | 0xe0000000 | 11100000.00000000.00000000.00000000 | |
| 240.0.0.0 | 268,435,456 | 268,435,454 | 1,048,576 | 15.255.255.255 | 0xf0000000 | 11110000.00000000.00000000.00000000 | |
| 248.0.0.0 | 134,217,728 | 134,217,726 | 524,288 | 7.255.255.255 | 0xf8000000 | 11111000.00000000.00000000.00000000 | |
| 252.0.0.0 | 67,108,864 | 67,108,862 | 262,144 | 3.255.255.255 | 0xfc000000 | 11111100.00000000.00000000.00000000 | |
| 254.0.0.0 | 33,554,432 | 33,554,430 | 131,072 | 1.255.255.255 | 0xfe000000 | 11111110.00000000.00000000.00000000 | |
| Class A default | 255.0.0.0 | 16,777,216 | 16,777,214 | 65,536 | 0.255.255.255 | 0xff000000 | 11111111.00000000.00000000.00000000 |
| 255.128.0.0 | 8,388,608 | 8,388,606 | 32,768 | 0.127.255.255 | 0xff800000 | 11111111.10000000.00000000.00000000 | |
| 255.192.0.0 | 4,194,304 | 4,194,302 | 16,384 | 0.63.255.255 | 0xffc00000 | 11111111.11000000.00000000.00000000 | |
| 255.224.0.0 | 2,097,152 | 2,097,150 | 8,192 | 0.31.255.255 | 0xffe00000 | 11111111.11100000.00000000.00000000 | |
| 255.240.0.0 | 1,048,576 | 1,048,574 | 4,096 | 0.15.255.255 | 0xfff00000 | 11111111.11110000.00000000.00000000 | |
| 255.248.0.0 | 524,288 | 524,286 | 2,048 | 0.7.255.255 | 0xfff80000 | 11111111.11111000.00000000.00000000 | |
| 255.252.0.0 | 262,144 | 262,142 | 1,024 | 0.3.255.255 | 0xfffc0000 | 11111111.11111100.00000000.00000000 | |
| 255.254.0.0 | 131,072 | 131,070 | 512 | 0.1.255.255 | 0xfffe0000 | 11111111.11111110.00000000.00000000 | |
| Class B default | 255.255.0.0 | 65,536 | 65,534 | 256 | 0.0.255.255 | 0xffff0000 | 11111111.11111111.00000000.00000000 |
| 255.255.128.0 | 32,768 | 32,766 | 128 | 0.0.127.255 | 0xffff8000 | 11111111.11111111.10000000.00000000 | |
| 255.255.192.0 | 16,384 | 16,382 | 64 | 0.0.63.255 | 0xffffc000 | 11111111.11111111.11000000.00000000 | |
| 255.255.224.0 | 8,192 | 8,190 | 32 | 0.0.31.255 | 0xffffe000 | 11111111.11111111.11100000.00000000 | |
| 255.255.240.0 | 4,096 | 4,094 | 16 | 0.0.15.255 | 0xfffff000 | 11111111.11111111.11110000.00000000 | |
| 255.255.248.0 | 2,048 | 2,046 | 8 | 0.0.7.255 | 0xfffff800 | 11111111.11111111.11111000.00000000 | |
| 255.255.252.0 | 1,024 | 1,022 | 4 | 0.0.3.255 | 0xfffffc00 | 11111111.11111111.11111100.00000000 | |
| 255.255.254.0 | 512 | 510 | 2 | 0.0.1.255 | 0xfffffe00 | 11111111.11111111.11111110.00000000 | |
| Class C default | 255.255.255.0 | 256 | 254 | 1 | 0.0.0.255 | 0xffffff00 | 11111111.11111111.11111111.00000000 |
| 255.255.255.128 | 128 | 126 | 1/2 | 0.0.0.127 | 0xffffff80 | 11111111.11111111.11111111.10000000 | |
| 255.255.255.192 | 64 | 62 | 1/4 | 0.0.0.63 | 0xffffffc0 | 11111111.11111111.11111111.11000000 | |
| 255.255.255.224 | 32 | 30 | 1/8 | 0.0.0.31 | 0xffffffe0 | 11111111.11111111.11111111.11100000 | |
| 255.255.255.240 | 16 | 14 | 1/16 | 0.0.0.15 | 0xfffffff0 | 11111111.11111111.11111111.11110000 | |
| 255.255.255.248 | 8 | 6 | 1/32 | 0.0.0.7 | 0xfffffff8 | 11111111.11111111.11111111.11111000 | |
| 255.255.255.252 | 4 | 2 | 1/64 | 0.0.0.3 | 0xfffffffc | 11111111.11111111.11111111.11111100 | |
| 255.255.255.254 | 2 | 2 a | 1/128 | 0.0.0.1 | 0xfffffffe | 11111111.11111111.11111111.11111110 | |
| 255.255.255.255 | 1 | 1 b | 1/256 | 0.0.0.0 | 0xffffffff | 11111111.11111111.11111111.11111111 |
Usable hosts = addresses − 2 (the network and broadcast addresses). a A /31 has two usable addresses on point-to-point links (RFC 3021). b A /32 is a single host. Class A, B and C are the default masks of the address classes that CIDR replaced in 1993 (RFC 1519, now RFC 4632).
No prefix matches. Clear the search to see the whole table.
Common IPv6 prefixes
| Prefix | Addresses | /64 networks | /48 sites | Typical use |
|---|---|---|---|---|
| /3 | 2^125 | 2^61 | 2^45 | All global unicast space IANA currently assigns from: 2000::/3. IANA IPv6 address space |
| /12 | 2^116 | 2^52 | 2^36 | IANA’s blocks for the regional registries, such as 2a00::/12 for RIPE NCC and 2400::/12 for APNIC. IANA IPv6 unicast assignments |
| /29 | 2^99 | 2^35 | 2^19 | The largest initial allocation an ISP can get from RIPE NCC without extra documentation (“/32 up to /29”). ripe-738 |
| /32 | 2^96 | 2^32 | 65,536 | The usual minimum initial allocation to an ISP (local internet registry). ripe-738 |
| /48 | 2^80 | 65,536 | 1 | One site or business customer — RIPE-690 recommends /48 for business end users (65,536 /64 networks). RIPE-690 |
| /56 | 2^72 | 256 | — | A residential customer — RIPE-690’s recommended minimum; longer prefixes are “strongly discouraged”. RIPE-690 |
| /60 | 2^68 | 16 | — | 16 /64 networks. Longer than RIPE-690’s recommended /56 minimum for end users. RIPE-690 |
| /64 | 2^64 | 1 | — | One network (LAN or VLAN). SLAAC on Ethernet and Wi-Fi works only with a /64, because the interface ID is 64 bits. RFC 4862 §5.5.3 |
| /126 | 4 | part of one | — | Four addresses; some operators use it on links between routers. RIPE-690 |
| /127 | 2 | part of one | — | A point-to-point link between two routers. RFC 6164 |
| /128 | 1 | part of one | — | A single address: loopbacks, host routes and allow-list entries. RFC 4291 |
IPv6 has no broadcast address, so every address of a prefix is usable.
About the Subnet Mask Cheat Sheet
A complete subnet mask cheat sheet: all 33 IPv4 prefix lengths from /0 to /32 with the dotted subnet mask, the wildcard (inverse) mask used in Cisco ACLs, the hexadecimal and binary forms, the number of addresses and usable hosts, and how many /24 networks each one equals. Below it, the common IPv6 prefix sizes — /48, /56, /64, /127 and others — with what they are normally used for and the source for each.
Search with whatever you have: /26, 255.255.255.192, 0.0.0.63, 0xffffffc0 or 50 hosts (it picks the smallest subnet that fits). Select any prefix — or type a CIDR such as 192.168.1.77/24 — to see its details and apply it to an address: the network, first and last usable address and broadcast address appear at once. Printed, both tables fit on one A4 or US Letter page at the browser’s default margins.
How to use it
- Type a prefix, mask, wildcard, hex or binary mask, a CIDR such as
10.20.30.77/27, or a number of hosts into the search box — the matching row is highlighted. - Select a prefix in the first column to open its details.
- Enter an IPv4 address under “Apply to an IPv4 address” to see its network, usable range and broadcast address for that prefix.
- Use Print for a paper copy, or Copy table / CSV to keep the reference in your notes.
Examples
50 hosts
/26 — 255.255.255.192 · 62 usable addresses, 12 to spare
255.255.240.0
/20 · wildcard 0.0.15.255 · 4,096 addresses, 4,094 usable · 16 /24s
/27 and 10.20.30.77
Network 10.20.30.64/27 · usable 10.20.30.65 – 10.20.30.94 · broadcast 10.20.30.95
Common uses
- Looking up a mask while configuring a router, firewall, server or cloud subnet.
- Converting between CIDR notation, dotted masks and Cisco wildcard masks.
- Studying subnetting for CCNA, Network+ or a networking course — and printing a reference sheet.
- Checking how many hosts a subnet holds before handing it out.
Reading the table
- Prefix: the number of leading 1-bits in the mask (CIDR notation, RFC 4632).
- Subnet mask: the same mask in dotted decimal, as most operating systems and routers expect it.
- Wildcard: the mask inverted (255 − each number). Cisco access lists and OSPF network statements use it.
- Hex: the mask as one hexadecimal number; macOS and BSD
ifconfigshow masks this way, for examplenetmask 0xffffff00. - Addresses / usable hosts: a /n has 2^(32 − n) addresses; hosts can use all but the network and broadcast addresses, so 2^(32 − n) − 2. A /31 is the exception for point-to-point links, where both addresses are usable (RFC 3021); a /32 is one host.
- /24s: how many /24 networks (256 addresses each) the prefix equals — handy when ranges are discussed in “class C” sized blocks. The figures match the table in RFC 1878.
Subnetting shortcuts
- Each extra prefix bit halves the block: a /24 has 256 addresses, a /25 has 128, a /26 has 64.
- Block size = 256 − the last non-zero number of the mask. For 255.255.255.224 that is 256 − 224 = 32, so subnets start at .0, .32, .64, .96 and so on.
- The broadcast address is the next subnet’s start minus one: in 192.168.1.64/27 it is 192.168.1.95.
- The default masks of the old address classes were /8 (class A), /16 (class B) and /24 (class C). CIDR replaced classes in 1993 (RFC 1519, now RFC 4632), but the names are still used.
IPv6 prefix sizes
IPv6 subnets are almost always /64: stateless address autoconfiguration (SLAAC) on Ethernet and Wi-Fi needs a 64-bit interface identifier (RFC 4862, RFC 2464). Sites receive a larger prefix and split it into /64s: RIPE-690 recommends a /48 for business customers and at least a /56 for residential ones. Links between routers may use a /127 (RFC 6164). IPv6 has no broadcast address, so no addresses are lost to it.
Limitations
- The host counts follow the standard rule (network and broadcast reserved). Some cloud providers reserve more addresses per subnet — check their documentation.
- Applying a prefix works for IPv4 addresses; use the IPv6 table as a size reference.
Privacy
Everything happens in your browser. What you enter or open here is not uploaded or stored by MySmartCoPilot.
Frequently asked questions
What is the subnet mask for /24?
255.255.255.0 — 256 addresses, of which 254 are usable by hosts. Its wildcard mask is 0.0.0.255 and in hex it is 0xffffff00.
How many usable hosts does a /30 or a /31 have?
A /30 (255.255.255.252) has 4 addresses and 2 usable hosts — the classic size for a link between two routers. A /31 (255.255.255.254) has 2 addresses, and RFC 3021 lets both be used on point-to-point links, which saves half the addresses.
What is a wildcard mask?
The subnet mask with every bit flipped: 255.255.255.0 becomes 0.0.0.255. Cisco access lists and OSPF use wildcard masks, where a 0 bit means “must match” and a 1 bit means “any value”.
How do I find the subnet for a number of hosts?
Add 2 (network and broadcast), round up to the next power of two and subtract its exponent from 32. 50 hosts → 52 → 64 = 2^6 → /26. Or type “50 hosts” into the search box.
Why is 255.255.0.255 not a valid subnet mask?
A subnet mask must be a run of 1-bits followed by 0-bits. 255.255.0.255 has 0-bits in the middle, so it does not describe a contiguous block of addresses and no prefix length matches it.
How do I print the cheat sheet?
Press Print. The search box and buttons are left out, and both tables fit on one A4 or US Letter page at the browser’s default margins. With wide margins (1 inch on US Letter) the IPv6 table moves to a second page.