Subnet Calculator | Network Address, Broadcast, Usable IP Range and Host Count, Subnet Mask and Wildcard Mask from an IP and CIDR, With VLSM Subnetting, IP Range to CIDR Conversion and Aggregation, and a Cheat Sheet

The Subnet Calculator takes an IPv4 address with a prefix length (CIDR) or subnet mask and shows the network address, broadcast address, first and last usable IP, number of usable addresses (hosts), subnet mask, wildcard mask, binary notation, class, address type such as private or public, and the reverse DNS zone. It works for any size from /0 to /32: a /24 has 254 hosts, a /26 has 62, and a /31 point-to-point link can use both addresses. You can switch to the usable count after the reserved addresses of an AWS VPC (the first 4 and the last 1, 5 in total), Azure (5) or Google Cloud (4), and check whether another IP is in the same subnet. The subnetting tab splits a network into equal parts, or builds a VLSM plan that gives each department or segment a subnet sized for the hosts it needs. It also converts a first and last IP address into the smallest list of CIDR blocks that covers exactly that range, aggregates several CIDR blocks (supernetting and route summarization), and has a cheat sheet of subnet masks, wildcard masks and address counts plus a list of special-purpose ranges such as private addresses, CGNAT (100.64.0.0/10) and link-local. Everything is calculated on your device, and the addresses you enter are not sent anywhere.

Calculate a subnet from an IP address and prefix

Enter something like “192.168.1.10/24” or “192.168.1.10 255.255.255.0” to get the network address, broadcast address, usable IP range and host count, subnet mask and wildcard mask.

IP address/prefix length (or subnet mask)

Prefix length

How to count unusable addresses

Network address

192.168.1.0/24

Usable IP range

192.168.1.1 〜 192.168.1.254

Usable addresses (hosts)

254

256 addresses in total

IP address192.168.1.1011000000.10101000.00000001.00001010
Network address192.168.1.011000000.10101000.00000001.00000000
Broadcast address192.168.1.25511000000.10101000.00000001.11111111
Subnet mask255.255.255.0 (/24)11111111.11111111.11111111.00000000
Wildcard mask0.0.0.25500000000.00000000.00000000.11111111
First IP192.168.1.1
Last IP192.168.1.254
Unusable addresses192.168.1.0, 192.168.1.255
Total addresses2561 × /24
Class (old classful scheme)Class C
Address typePrivate address (for office and home LANs)192.168.0.0/16 (RFC 1918)
Hexadecimal / decimal0xC0A8010A3,232,235,786
Reverse DNS zone1.168.192.in-addr.arpa

The first address (network) and the last (broadcast) cannot be assigned to devices. A /31 is for a point-to-point link between two devices (RFC 3021) and both addresses are usable; a /32 means a single host.

Is this IP address in this subnet?

This calculator is for IPv4. Addresses are calculated on your device and not sent anywhere.

ABOUT

About Subnet Calculator | Network Address, Broadcast, Usable IP Range and Host Count, Subnet Mask and Wildcard Mask from an IP and CIDR, With VLSM Subnetting, IP Range to CIDR Conversion and Aggregation, and a Cheat Sheet

The Subnet Calculator is a free tool that takes an IPv4 address with a CIDR prefix (such as /24) or a subnet mask and shows the network address, broadcast address, usable IP range and host count, subnet mask and wildcard mask. It also does VLSM subnetting from the hosts you need, converts IP ranges to CIDR and aggregates them, and can subtract the reserved addresses of AWS, Azure and Google Cloud.

How to use Subnet Calculator | Network Address, Broadcast, Usable IP Range and Host Count, Subnet Mask and Wildcard Mask from an IP and CIDR, With VLSM Subnetting, IP Range to CIDR Conversion and Aggregation, and a Cheat Sheet

  1. 1On the “Subnet calculator” tab, enter an IP address with a prefix length or subnet mask, such as “192.168.1.10/24” or “192.168.1.10 255.255.255.0”
  2. 2Check the network address, broadcast address, usable IP range and count, and wildcard mask. For the cloud, choose AWS, Azure or Google Cloud to subtract the reserved addresses
  3. 3To divide a network, open the “Subnetting (VLSM)” tab and enter the original network and the hosts each segment needs, one per line
  4. 4To write an IP range in a firewall or ACL, enter the first and last IP on the “Range → CIDR & aggregation” tab and copy the CIDR blocks
  5. 5On the “Cheat sheet” tab, look up the subnet mask, wildcard mask and address count for /0 to /32, and the special-purpose IP ranges

Great for

  • Checking the usable range on the same segment before giving a router or NAS a static IP
  • Finding out how many devices fit in a /24, /26 or /27
  • Designing subnets in an AWS VPC, Azure or Google Cloud and knowing how many IPs are really usable
  • Making a subnet allocation plan (VLSM) from the number of hosts each department or floor needs
  • Turning a range such as 10.0.0.5–10.0.0.20 into CIDR blocks for a firewall rule or an AWS security group
  • Getting the wildcard mask to write in a Cisco ACL or OSPF
  • Checking subnetting questions for exams such as CCNA

Good to know

  • A subnet has 2 to the power of (32 − prefix length) addresses. The first (network address) and the last (broadcast address) cannot be given to devices, so 2 fewer are usable. A /24 has 256 addresses and 254 usable, a /26 has 64 and 62, a /27 has 32 and 30, and a /30 has 4 and 2.
  • A /31 is for a point-to-point link between two routers (RFC 3021): it has no network or broadcast address and both addresses are usable. A /32 means a single host and is used to point at one IP, for example in a firewall rule.
  • An AWS VPC reserves 5 addresses in every subnet: the first 4 (network, VPC router, DNS, future use) and the last 1. So a /28 (16 addresses) has 11 usable and a /24 has 251. Azure also reserves 5, and Google Cloud reserves 4.
  • A wildcard mask is the subnet mask with its 0s and 1s flipped: for a /24 (255.255.255.0) it is 0.0.0.255. It is used in Cisco ACLs and the OSPF network command.
  • When an IP range does not start and end on block boundaries, it splits into several CIDR blocks. 10.0.0.5–10.0.0.20 becomes five: 10.0.0.5/32, 10.0.0.6/31, 10.0.0.8/29, 10.0.0.16/30 and 10.0.0.20/32, while 192.168.0.0–192.168.3.255 is just 192.168.0.0/22. IPv6 is not supported.

Questions this tool answers

Use Subnet Calculator | Network Address, Broadcast, Usable IP Range and Host Count, Subnet Mask and Wildcard Mask from an IP and CIDR, With VLSM Subnetting, IP Range to CIDR Conversion and Aggregation, and a Cheat Sheet for searches like these:

  • Calculate the network and broadcast address from an IP address and CIDR
  • Know the usable IP range and number of hosts in a subnet
  • Know how many IPs are usable in an AWS, Azure or Google Cloud subnet
  • Split a network into subnets by the hosts needed (VLSM)
  • Convert an IP address range to CIDR or aggregate CIDR blocks
  • See a cheat sheet of subnet masks and wildcard masks

FAQ

How many devices can I connect in a /24 or a /27?
A /24 (255.255.255.0) has 256 addresses, so 254 hosts after removing the network and broadcast addresses. A /25 has 126, a /26 62, a /27 30, a /28 14, a /29 6 and a /30 2. The router (default gateway) also uses one, so one fewer is left for computers and phones.
How do I find the network address and broadcast address?
Write the IP address and subnet mask in binary and AND them to get the network address; set every host bit (where the mask is 0) of the network address to 1 to get the broadcast address. For 192.168.1.100/26 the mask is 255.255.255.192, the network address is 192.168.1.64, the broadcast address is 192.168.1.127, and the usable range is 192.168.1.65 to 192.168.1.126.
How many IP addresses can I use in an AWS subnet?
The number of addresses in the subnet minus 5. AWS reserves the first 4 (network address, VPC router, DNS server, future use) and the last 1. A /24 gives 256 − 5 = 251, and the smallest, a /28, gives 16 − 5 = 11. Choose AWS under “How to count unusable addresses” to see which IPs are reserved.
How do I split a network with VLSM?
Starting with the segment that needs the most hosts, give each one the smallest power-of-two block of at least hosts + 2 (network and broadcast) and pack them from the start. Splitting 192.168.1.0/24 into 100, 50, 20 and 2 hosts gives 192.168.1.0/25 (126 hosts), 192.168.1.128/26 (62), 192.168.1.192/27 (30) and 192.168.1.224/30 (2), leaving everything from 192.168.1.228 free.
How do I convert an IP address range to CIDR?
Enter the first and last IP on the “Range → CIDR & aggregation” tab, and it gives the smallest list of CIDR blocks that covers exactly that range. An aligned range such as 192.168.0.0–192.168.3.255 is a single 192.168.0.0/22, while an unaligned one such as 10.0.0.5–10.0.0.20 splits into five CIDR blocks.
What are the private IP address ranges?
RFC 1918 defines three: 10.0.0.0/8 (10.0.0.0–10.255.255.255), 172.16.0.0/12 (172.16.0.0–172.31.255.255) and 192.168.0.0/16 (192.168.0.0–192.168.255.255). In addition, 100.64.0.0/10, used for carrier-grade NAT on mobile networks, and 169.254.0.0/16, used when a device cannot get an IP from DHCP, are not used on the internet.