Home › Azure Tools › Azure Subnet Calculator

Azure Subnet Calculator

Enter an IPv4 CIDR range to see its network, broadcast, masks and total size, plus the usable hosts left after Azure reserves five addresses.

All of this is whole-number arithmetic on 32-bit addresses, so there is no rounding. An address that is not the network address (for example 192.168.1.77/26) is accepted, and the tool tells you which network it belongs to. Nothing you type is sent or stored.

How to use

  1. Choose Calculate one subnet and type a range such as 10.0.1.0/24. Use four numbers from 0 to 255, a slash, and a prefix length from 0 to 32.
  2. Read the network address, broadcast address, netmask, wildcard mask and total address count. These are standard IPv4 values.
  3. Read Azure usable hosts, the first and the last assignable Azure IP. These are the addresses a resource in the subnet can actually receive.
  4. To plan a virtual network, choose Split a range into equal subnets, enter the VNet range and a power of two. The tool lists each subnet with its usable range.
  5. If the result is red, read the message. It says what is wrong with the input or why Azure would refuse the size.

Worked example

Take 10.0.1.0/24. The prefix is 24, so 8 host bits remain and the subnet holds 28 = 256 addresses. The network address is 10.0.1.0 and the broadcast address is 10.0.1.255. The netmask is 255.255.255.0 and the wildcard is 0.0.0.255.

Azure keeps 5 of those 256 addresses, so 251 are usable. The first assignable address is 10.0.1.4 and the last is 10.0.1.254. The addresses 10.0.1.1 to 10.0.1.3 and 10.0.1.255 are not available to your resources.

A second example shows the splitting mode. The range 10.20.0.0/16 split into 8 equal subnets gives eight /19 subnets. Each has 8,192 addresses and 8,187 usable in Azure. The first is 10.20.0.0/19 and the second is 10.20.32.0/19.

PrefixTotal addressesAzure usable
/2983
/281611
/273227
/266459
/24256251
/1665,53665,531

How it works

An IPv4 address is a 32-bit number. The prefix length says how many of the leftmost bits identify the network. The remaining bits identify hosts. The tool turns the address into one whole number and applies these rules:

host bits  = 32 - prefix
total      = 2 ^ host bits
netmask    = the top prefix bits set to 1
wildcard   = netmask with every bit flipped
network    = address AND netmask
broadcast  = network + total - 1
Azure usable = total - 5
first IP   = network + 4
last IP    = broadcast - 1

Microsoft's virtual network FAQ says Azure reserves the first four addresses and the last address in every subnet, five in all. For 192.168.1.0/24 it lists the network address (.0), the default gateway (.1), two addresses that map the Azure DNS IP addresses into the virtual network space (.2 and .3), and the network broadcast address (.255).

The same page states the size limits: the smallest supported IPv4 subnet is /29 and the largest is /2. A /29 has 8 addresses, so it leaves 3 usable. A /30, /31 or /32 would leave zero or fewer, and the tool says "not valid in Azure" for them. Source: Azure Virtual Network FAQ on Microsoft Learn. Limits can change, so check that page for the current rules.

Splitting adds the base-2 logarithm of the count to the prefix. Eight subnets add 3 bits, so a /16 becomes /19. The count must be a power of two for the subnets to be equal. The tool refuses a split that would produce subnets smaller than /29.

Azure exam relevance

Virtual network and subnet design appears in the networking objectives of AZ-104 (Azure Administrator) and in the core networking objectives of AZ-700 (Azure Network Engineer Associate). Typical questions give an address space and ask how many subnets or hosts fit, whether two ranges overlap, or why a subnet is too small. Knowing the five reserved addresses lets you answer "how many VMs fit in a /27" without guessing: 27, not 30. Study pages: AZ-104 virtual networks and subnets and the AZ-700 hub.

Common mistakes

Frequently asked questions

Why does Azure reserve five addresses?

Four at the start and one at the end: the network address, the default gateway, two for Azure DNS and the broadcast address.

What is the smallest subnet I can create?

A /29, which has 8 addresses and 3 usable. The largest supported IPv4 subnet is a /2.

Does the calculator support IPv6?

No. It covers IPv4 only. The Microsoft FAQ says IPv6 subnets must be exactly /64.

Why is my usable host count different from another subnet calculator?

Generic calculators subtract 2 (network and broadcast). Azure removes 5.

Does a service subnet follow the same rules?

The five-address reservation applies to every subnet. Some Azure services set their own minimum or recommended subnet size, so check the service's documentation before you size a subnet for it.

Is anything stored or sent?

No. The maths runs in your browser.

Related tools