N-01 · Subnet · /18
/18 subnet
A /18 network keeps 18 of the 32 address bits for the network and leaves 14 for hosts. Its mask, host count, the blocks it fits in and example networks, all worked out below.
Short answer
- Subnet mask
- 255.255.192.0Wildcard 0.0.63.255
- Usable hosts
- 16,38216,384 addresses in total
2^14 = 16,384 addresses. The first is the network address and the last the broadcast, so 16,382 can go to devices.
The /18 mask in binary and hex
18 one bits, then 14 zero bits. The wildcard is the mask inverted.
| Mask | Dotted | Hex |
|---|---|---|
| Subnet mask | 255.255.192.0 | FF.FF.C0.00 |
| Wildcard | 0.0.63.255 | 00.00.3F.FF |
The mask ends inside the third octet, at 192 (11000000). That leaves 6 host bits in the octet, so /18 networks start every 64 in it: 0, 64, 128, 192 and so on. Cisco access lists take the wildcard form, 0.0.63.255, where a 1 bit means “any value” (Cisco document 23602).
RFC 1878's table lists /18 as FF.FF.C0.00 hex, 16 K addresses, equal to 64 C in the old class terms. Its Table 1-1 counts a /18 as 4 subnets of a class B network with 16,382 hosts each. Erratum 3147 corrects that table's last row for each size: the all-ones subnet ends at N.N.255.255.
How many /18 subnets fit
The three private ranges (RFC 1918) and one /24.
| Block | /18 subnets in it |
|---|---|
| 10.0.0.0/8 | 1,024 |
| 172.16.0.0/12 | 64 |
| 192.168.0.0/16 | 4 |
| 192.168.181.0/24 | none: one /18 holds 64 |
10.0.0.0/8 holds 1,024, 172.16.0.0/12 holds 64 and 192.168.0.0/16 holds 4 /18 subnets. One /18 spans 64 /24s.
Splitting a /18
Each extra prefix bit halves the block.
| Into | Subnets | Usable each |
|---|---|---|
| /19 | 2 | 8,190 |
| /20 | 4 | 4,094 |
| /21 | 8 | 2,046 |
Two /19 subnets hold 16,380 usable addresses between them, 2 fewer than one /18: each half gives up its own network and broadcast address.
/18 subnets of 192.168.0.0/16
192.168.0.0/16 holds 4 of them. The row in bold holds 192.168.181.150.
| Subnet | First usable | Last usable |
|---|---|---|
| 192.168.0.0/18 | 192.168.0.1 | 192.168.63.254 |
| 192.168.64.0/18 | 192.168.64.1 | 192.168.127.254 |
| 192.168.128.0/18 | 192.168.128.1 | 192.168.191.254 |
| 192.168.192.0/18 | 192.168.192.1 | 192.168.255.254 |
Check an address
Pre-filled with 192.168.181.150/18. Change the address or the prefix.
Result
192.168.128.0/18
16,382 usable hosts
- Network
- 192.168.128.0
- First usable
- 192.168.128.1
- Last usable
- 192.168.191.254
- Broadcast
- 192.168.191.255
- Subnet mask
- 255.255.192.0
- Wildcard mask
- 0.0.63.255
- Total addresses
- 16,384
Inside 192.168.0.0/16, a private range (RFC 1918). Not routable on the public internet.
Binary view
- Address · 192.168.181.150
- 11000000.10101000.10110101.10010110
- Mask · 255.255.192.0
- 11111111.11111111.11000000.00000000
- Network · 192.168.128.0
- 11000000.10101000.10000000.00000000
Bold bits are fixed for the network; orange bits number the hosts.
192.168.0.0/16 split into /18
- 192.168.128.0/18.128.1–.191.254 ◂
/18 next to /17 and /19
One bit shorter, a /17 (255.255.128.0) has 32,768 addresses and 32,766 usable, 16,384 more than a /18. One bit longer, /19 (255.255.224.0) has 8,192 addresses and 8,190 usable. /17 subnet · /19 subnet
Ask the calculator for a host count and it answers /18 for 8,191 to 16,382 hosts: typing "192.168.128.0 16,382 hosts" gives this size, one more host gives a /17.
Worked example
Take 192.168.181.150/18. The mask ends in the third octet. There the address is 181 = 10110101 and the mask 192 = 11000000; AND keeps the first 2 bits: 10000000 = 128. The octets after it become 0, so the network is 192.168.128.0. OR the wildcard 0.0.63.255 onto it to set every host bit: 192.168.191.255, the broadcast.
Devices use 192.168.128.1 through 192.168.191.254: 16,382 addresses. 192.168.181.150 is number 13,718 of them. In 192.168.0.0/16 this is subnet 3 of 4.
References
- RFC 4632, Classless Inter-domain Routing (CIDR), §3.1: prefix lengths and block sizes.
- RFC 950, Internet Standard Subnetting Procedure: subnet masks.
- RFC 1878, Variable Length Subnet Table For IPv4, Table 1-1, with erratum 3147 (all-ones subnet rows).
- RFC 1918, Address Allocation for Private Internets: 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16.
Other prefixes
Related tools
- Subnet calculatorNetwork, broadcast, host range, masks and a binary view from any IPv4 or IPv6 address and prefix.
- CIDR calculatorTurn IPv4 or IPv6 ranges into the fewest CIDR blocks, merge a list, and check it for overlaps.
- VLAN plannerCarve a parent block into right-sized subnets with VLAN IDs, then export CSV or Markdown.