Skip to content
Esc

Subnet calculator

Network, broadcast, host range and mask for a block.

IPv4

Prefix
/21

Try

Network
172.16.40.0
Broadcast
172.16.47.255
First host
172.16.40.1
Last host
172.16.47.254
Usable hosts
2,046
Total
2,048
Mask
255.255.248.0
Wildcard
0.0.7.255
Type
Private (RFC 1918)
Class
Bhistorical, before CIDR
Hex
0xAC102800
Integer
2886739968
Reverse DNS
0.40.16.172.in-addr.arpa
IPv4-mapped
::ffff:172.16.40.0

Bits

21 network bits11 host bits

Binary

Network
10101100.00010000.00101000.00000000
Broadcast
10101100.00010000.00101111.11111111
Mask
11111111.11111111.11111000.00000000
Wildcard
00000000.00000000.00000111.11111111

8 subnets · 254 usable hosts each

  1. 1172.16.40.0/24254
  2. 2172.16.41.0/24254
  3. 3172.16.42.0/24254
  4. 4172.16.43.0/24254
  5. 5172.16.44.0/24254
  6. 6172.16.45.0/24254
  7. 7172.16.46.0/24254
  8. 8172.16.47.0/24254
Plan subnets from host counts

172.16.40.0/21, 2,046 usable hosts

About this tool

Runs in
your browser
Your input sent to our servers
Nothing
Kept on this device
nothing

More in the privacy policy.

How to use it

  1. 01Type or paste an address with a prefix, such as 10.0.0.0/8 or 2001:db8::/32, or pick one under Try.
  2. 02Read the network, usable range and mask (and broadcast for IPv4), and copy any value. Below them are the address you typed in other forms: its reverse DNS name and, for IPv4, its class, hex and integer forms and its IPv4-mapped IPv6 address.
  3. 03Choose Split into to cut the block into equal subnets, then copy them all or download CSV.

Related tools

Questions

Why are there 2 fewer usable hosts than addresses?

The first address identifies the network and the last is the broadcast address, so a /24 has 256 addresses and 254 usable hosts. A /31 point-to-point link uses both of its addresses (RFC 3021), and a /32 is a single host.

What is the wildcard mask?

The subnet mask with every bit flipped: 0.0.7.255 for a /21. Cisco access lists and OSPF use it.

What are address classes?

Before CIDR replaced them in 1993, the first bits of an IPv4 address fixed its network size: class A (first byte 0–127) was a /8, class B (128–191) a /16 and class C (192–223) a /24; class D (224–239) is multicast and class E (240–255) reserved. Networks are no longer sized by class, but the terms still appear in exams and older documentation.

Is my input sent anywhere?

No. The calculator runs in this tab. Your input isn't sent to our servers, and it isn't kept after you leave the page.