Free tool

Subnet and broadcast address calculator

Updated

Enter an IPv4 address with a prefix or subnet mask. You get the network and broadcast addresses, the usable host range, host count, masks, and how the subnet splits into smaller ones. It runs in your browser.

Network bits Host bits

Address
Mask
Network

Draw this as a VLAN in NetworkSketch

How many hosts do I need?

Count every address you'll assign, the gateway included. You get the smallest subnet that holds them.

Planning several subnets inside one block? The VLSM subnet planner sizes and places them all at once.

Split this subnet

SubnetUsable rangeBroadcastHosts

Planning the addressing for a network diagram?

In NetworkSketch, every VLAN area holds its subnet and gateway, and the network check flags any device whose IP falls outside it. Check a whole list at once with the IP plan checker, or plan every subnet in a block with the VLSM planner.

Try it, no signup

Subnet mask cheat sheet

Every prefix length with its mask and host counts. /31 is for point-to-point links (both addresses usable) and /32 is a single host.

PrefixSubnet maskAddressesUsable hosts
/00.0.0.04,294,967,2964,294,967,294
/1128.0.0.02,147,483,6482,147,483,646
/2192.0.0.01,073,741,8241,073,741,822
/3224.0.0.0536,870,912536,870,910
/4240.0.0.0268,435,456268,435,454
/5248.0.0.0134,217,728134,217,726
/6252.0.0.067,108,86467,108,862
/7254.0.0.033,554,43233,554,430
/8255.0.0.016,777,21616,777,214
/9255.128.0.08,388,6088,388,606
/10255.192.0.04,194,3044,194,302
/11255.224.0.02,097,1522,097,150
/12255.240.0.01,048,5761,048,574
/13255.248.0.0524,288524,286
/14255.252.0.0262,144262,142
/15255.254.0.0131,072131,070
/16255.255.0.065,53665,534
/17255.255.128.032,76832,766
/18255.255.192.016,38416,382
/19255.255.224.08,1928,190
/20255.255.240.04,0964,094
/21255.255.248.02,0482,046
/22255.255.252.01,0241,022
/23255.255.254.0512510
/24255.255.255.0256254
/25255.255.255.128128126
/26255.255.255.1926462
/27255.255.255.2243230
/28255.255.255.2401614
/29255.255.255.24886
/30255.255.255.25242
/31255.255.255.25422
/32255.255.255.25511

Questions

Why are there two fewer usable hosts than addresses?

The first address in a subnet is the network address and the last is the broadcast address; neither can be assigned to a device. The exception is a /31, used on point-to-point links, where both addresses are usable (RFC 3021).

What's a wildcard mask?

The inverse of the subnet mask (0.0.0.255 for a /24). Cisco ACLs and OSPF network statements use it to say which bits must match.

What subnet size do I need for 50 hosts?

A /26: 64 addresses, 62 of them usable. Count every address you will assign, the gateway included, then take the smallest prefix whose usable hosts cover it: up to 6 is a /29, 14 a /28, 30 a /27, 62 a /26, 126 a /25 and 254 a /24.

Is anything I type sent anywhere?

No. The calculator runs on this page in your browser, and the page has no analytics or tracking. The address you enter is kept in the part of the link after the # so you can share it, and browsers never send that part to the server.