NetCalcLab

/20 Subnet Mask — 255.255.240.0

Everything about the /20 prefix: the subnet mask 255.255.240.0, wildcard mask 0.0.15.255, 4,096 addresses with 4,094 usable hosts, and how the block is laid out in practice.

Accepts /24, a bare 24, a dotted subnet mask such as 255.255.255.0, or a wildcard mask such as 0.0.0.255.

Examples:

Complete CIDR reference table

Every valid IPv4 prefix from /0 to /32 with its mask, wildcard and address counts.

CIDR to subnet mask reference table
PrefixSubnet maskWildcardTotal addressesUsable hostsBlock size
/00.0.0.0255.255.255.2554,294,967,2964,294,967,2944,294,967,296
/1128.0.0.0127.255.255.2552,147,483,6482,147,483,6462,147,483,648
/2192.0.0.063.255.255.2551,073,741,8241,073,741,8221,073,741,824
/3224.0.0.031.255.255.255536,870,912536,870,910536,870,912
/4240.0.0.015.255.255.255268,435,456268,435,454268,435,456
/5248.0.0.07.255.255.255134,217,728134,217,726134,217,728
/6252.0.0.03.255.255.25567,108,86467,108,86267,108,864
/7254.0.0.01.255.255.25533,554,43233,554,43033,554,432
/8255.0.0.00.255.255.25516,777,21616,777,21416,777,216
/9255.128.0.00.127.255.2558,388,6088,388,6068,388,608
/10255.192.0.00.63.255.2554,194,3044,194,3024,194,304
/11255.224.0.00.31.255.2552,097,1522,097,1502,097,152
/12255.240.0.00.15.255.2551,048,5761,048,5741,048,576
/13255.248.0.00.7.255.255524,288524,286524,288
/14255.252.0.00.3.255.255262,144262,142262,144
/15255.254.0.00.1.255.255131,072131,070131,072
/16255.255.0.00.0.255.25565,53665,53465,536
/17255.255.128.00.0.127.25532,76832,76632,768
/18255.255.192.00.0.63.25516,38416,38216,384
/19255.255.224.00.0.31.2558,1928,1908,192
/20255.255.240.00.0.15.2554,0964,0944,096
/21255.255.248.00.0.7.2552,0482,0462,048
/22255.255.252.00.0.3.2551,0241,0221,024
/23255.255.254.00.0.1.255512510512
/24255.255.255.00.0.0.255256254256
/25255.255.255.1280.0.0.127128126128
/26255.255.255.1920.0.0.63646264
/27255.255.255.2240.0.0.31323032
/28255.255.255.2400.0.0.15161416
/29255.255.255.2480.0.0.7868
/30255.255.255.2520.0.0.3424
/31255.255.255.2540.0.0.122 (RFC 3021)2
/32255.255.255.2550.0.0.0111

Quick reference: mask to prefix

Reading a mask written in dotted-decimal form. Count the 1 bits, or use the octet boundaries below.

Subnet mask to CIDR prefix lookup
Subnet maskPrefixWildcardUsable hostsBlock size
255.255.255.128/250.0.0.128126128
255.255.255.192/260.0.0.646264
255.255.255.224/270.0.0.323032
255.255.255.240/280.0.0.161416
255.255.255.248/290.0.0.868
255.255.255.252/300.0.0.424
255.255.255.254/310.0.0.202
255.255.255.255/320.0.0.101

Example: 255.255.255.224 has three 1 bits in its last octet, so the prefix is 24 + 3 = /27, the wildcard is 0.0.0.31 and there are 32 addresses of which 30 are usable.

What a /20 means

The number after the slash counts the network bits, so a /20 has 20 network bits and 12 host bits. Those 12 bits are what produce the address count: 2^12 = 4,096 addresses in the block.

/20 in four notations
Prefix        /20
Subnet mask   255.255.240.0
Wildcard      0.0.15.255
Binary mask   11111111.11111111.11110000.00000000
Host bits     12

A common ISP or large-campus allocation, 4,096 addresses.

A worked /20 block

Taking 192.168.0.0 as the starting point and applying the /20 mask gives the boundaries below. The network address is the base with every host bit cleared, and the broadcast address is the base with every host bit set — which is why they are always the first and last addresses in the block.

192.168.0.0/20

Network address   192.168.0.0
First host 192.168.0.1 Last host 192.168.15.254
Broadcast 192.168.15.255
Usable hosts 4,094 of 4,096 addresses

Consecutive /20 blocks start every 4,096 addresses — that spacing is the block size, and it is the same number as the address count. A /20 block that does not begin on a multiple of 4,096 overlaps its neighbour, which is the most common subnetting error in a hand-written address plan.

Sizing a /20

To decide whether a /20 fits a requirement, compare the usable host count against the number of devices you need to address, then add spare capacity.

Capacity and fit for a /20
MeasureValueWhat it means
Network bits20Fixed portion identifying the subnet
Host bits12Bits available for device addresses
Total addresses4,096The size of the block
Usable hosts4,094Excludes the network and broadcast address
Block size4,096Spacing between consecutive subnets

Subnets inside a /20

Splitting a /20 by borrowing one more bit produces two /21 blocks, each half the size. Borrowing two bits produces four /22 blocks, and so on. The counts are always powers of two.

Subnets contained in a /20
Child prefixBlocks that fitAddresses eachTotal addresses
/2122,0484,096
/2241,0244,096
/2385124,096
/24162564,096

Use the VLSM planner when the subnets inside a /20 need to be different sizes — for example a /25 for a user VLAN and several /30s for the links between switches.

Common mistakes

  • Forgetting the two reserved addresses. A /20 has 4,096 addresses but only 4,094 assignable to devices. Sizing a subnet at exactly 4,094 hosts of requirement leaves nothing for the network and broadcast address.
  • Writing the mask wrong. There is exactly one valid mask for a /20: 255.255.240.0. Anything else is a different prefix and will silently create a different network.
  • Using the wildcard as the mask. 0.0.15.255 is the wildcard for a /20, not the mask. In a Cisco ACL the wildcard convention is inverted, so the two get swapped constantly.
  • Starting the subnet off its boundary. A /20 must start on a multiple of 4,096. Starting anywhere else overlaps neighbouring subnets and produces routing loops or unreachable ranges.
  • Assuming a /20 is the right size for every case. Check the host requirement first — the CIDR calculator has a host-to-prefix cheat sheet, and the subnet calculator shows the full breakdown for any address.

Other prefixes

Jump to another prefix, or see the complete table with all 33 values.

Neighbouring prefixes compared

/20 compared with the prefixes either side of it
PrefixMaskHostsBlock sizeRelationship
/18255.255.192.016,38216,384A further halving or doubling
/19255.255.224.08,1908,192Half the hosts — one bit borrowed
/20255.255.240.04,0944,096This page
/21255.255.248.02,0462,048Double the hosts — one bit returned
/22255.255.252.01,0221,024A further halving or doubling

Every step to a shorter prefix doubles the address count, and every step to a longer prefix halves it. That single rule explains the whole table.

Related: CIDR calculator, subnet calculator, VLSM planner, CIDR notation explained, subnetting guide.

IP to Binary Converter · Binary to IP Converter · IP to Hex Converter · Hex to IP Converter · IP to Decimal Converter ·

Frequently asked questions

What is the subnet mask for a /20?

The subnet mask for a /20 is 255.255.240.0. It is 20 consecutive 1 bits followed by 12 0 bits, which is what makes the host portion of the address 12 bits wide. The corresponding wildcard mask is 0.0.15.255, which is the bitwise inverse and is what you would use in a Cisco ACL or an OSPF network statement.

How many addresses are in a /20?

A /20 contains 2^12 = 4,096 addresses. That follows directly from the host bit count: a /20 leaves 12 bits for the host portion, and each bit doubles the count. Every step to a longer prefix halves this number, and every step to a shorter prefix doubles it.

How many usable hosts does a /20 have?

A /20 has 4,094 usable host addresses out of 4,096 total. The two that are not assignable are the network address, which has all 12 host bits set to 0, and the broadcast address, which has all 12 host bits set to 1. That is why the usable count is always exactly two less than the total.

What is the block size of a /20?

The block size is 4,096, the same as the address count. Consecutive /20 subnets therefore start every 4,096 addresses. A /20 that does not begin on a multiple of 4,096 overlaps its neighbours, which causes addresses to be unreachable or routed to the wrong place.

How do I split a /20 into smaller subnets?

Borrow one bit to create two /21 subnets of 2,048 addresses each. Borrow two bits for four /22 subnets, three bits for eight /23 blocks, and so on. The count of child subnets is always a power of two equal to 2 raised to the number of borrowed bits.

Is a /20 a private or public subnet?

The prefix length says nothing about whether an address is private or public — that is determined by the address range, not the mask. A 192.168.1.0/24 is private because it sits inside the RFC 1918 block 192.168.0.0/16, while 203.0.113.0/24 is documentation space and 8.8.8.0/24 is public. Use the subnet calculator with any address in the block to see its classification.