Skip to content
LookupOwl

Subnet calculator

Work out the network, broadcast and usable range of any CIDR block, and split it into smaller ones.

IPv4 or IPv6, like 10.0.0.0/16.

More options

Also split the network into subnets of this prefix length (longer than the network prefix). Rows are returned 256 at a time.

Subtract the addresses a cloud provider reserves per subnet (IPv4 only): aws and azure keep 5, gcp keeps 4.

Results for 10.0.0.0/22

Calculated just now

JSON

Private-Use · RFC 1918

Room for 1,022 hosts

10.0.0.0/22 is a private range — perfect for internal networks, never routed on the public internet.

IPv4Not public
Usable hosts
1,022

1,024 addresses in total

How the 32 bits split

The first 22 bits name the network; the last 10 are for hosts.

Netmask
255.255.252.0

/22 · wildcard 0.0.3.255

Usable range
10.0.0.1 – 10.0.3.254

Broadcast 10.0.3.255

Addresses
CIDR
10.0.0.0/22
Network address
10.0.0.0
Netmask
255.255.252.0
Wildcard mask
0.0.3.255
Broadcast
10.0.3.255
First address
10.0.0.0
Last address
10.0.3.255
First usable
10.0.0.1
Last usable
10.0.3.254
Total addresses
1,024
Usable addresses
1,022
Host bits
10
Historic class
A (obsolete since CIDR)
Other forms
Network (binary)
00001010.00000000.00000000.00000000
Netmask (binary)
11111111.11111111.11111100.00000000
Network (hex)
0x0a000000
Netmask (hex)
0xfffffc00
Network (integer)
167772160
Last address (integer)
167773183

Inside IPv6 transition prefixes

IPv4-mapped
::ffff:10.0.0.0/118
6to4
2002:a00::/38
NAT64
64:ff9b::10.0.0.0/118
Notes1
  • The prefix is not on an octet boundary, so there is no single reverse zone: delegate with RFC 2317 classless in-addr.arpa records.
Structured result (JSON) · 1.2 KB
{
  "version": 4,
  "cidr": "10.0.0.0/22",
  "network": "10.0.0.0",
  "prefix": 22,
  "form": "cidr",
  "address": "10.0.0.0",
  "hostBitsSet": false,
  "netmask": "255.255.252.0",
  "wildcard": "0.0.3.255",
  "broadcast": "10.0.3.255",
  "firstAddress": "10.0.0.0",
  "lastAddress": "10.0.3.255",
  "firstUsable": "10.0.0.1",
  "lastUsable": "10.0.3.254",
  "totalAddresses": "1024",
  "hostBits": 10,
  "usableAddresses": "1022",
  "usableRule": "standard",
  "addressType": {
    "kind": "private",
    "name": "Private-Use",
    "rfc": "RFC 1918",
    "block": "10.0.0.0/8",
    "isPublic": false
  },
  "ipClass": "A",
  "binary": {
    "network": "00001010.00000000.00000000.00000000",
    "netmask": "11111111.11111111.11111100.00000000"
  },
  "hex": {
    "network": "0x0a000000",
    "netmask": "0xfffffc00"
  },
  "integer": {
    "network": "167772160",
    "last": "167773183"
  },
  "reverseZone": null,
  "embedded": {
    "ipv4Mapped": "::ffff:10.0.0.0/118",
    "sixToFour": "2002:a00::/38",
    "nat64": "64:ff9b::10.0.0.0/118"
  },
  "notes": [
    "The prefix is not on an octet boundary, so there is no single reverse zone: delegate with RFC 2317 classless in-addr.arpa records."
  ],
  "warnings": []
}

What the calculator gives you

Type a network such as 10.0.0.0/22 and you get what you need to configure or document it: the network and broadcast addresses, the first and last usable host, how many addresses and usable hosts it holds, the subnet mask and its inverse (the wildcard mask), the type of address and the reverse DNS zone. A bit-by-bit view shows where the network part ends and the host part begins. IPv6 works too, with exact counts even when they are too big for a spreadsheet.

The calculation is plain arithmetic and never contacts the network you enter. The text itself is sent to our server to be calculated. It is not written to logs and is held in memory for at most a day. On the website, Google Analytics also records what you enter, as the privacy policy explains. If you want to keep an internal plan fully offline, Python's ipaddress module does the same sums.

How to use it

  1. Enter a networkUse CIDR (192.168.10.0/26), an address with a netmask (192.168.10.5 255.255.255.192), an address with a wildcard (192.168.10.5 0.0.0.63), a range that is exactly one block, or a single address. IPv6 works the same way: 2001:db8::/48.
  2. Split it if you need toUnder More options, choose a longer prefix, say /28, to carve the network into equal subnets. Large splits come back 256 rows at a time.
  3. Account for the cloudPick AWS, Azure or Google Cloud to subtract the addresses that provider reserves in every subnet. This works for IPv4 only, and the result warns you if the subnet is a size the provider does not allow, such as smaller than a /28 in AWS.

Reading the numbers

PrefixNetmaskTotalUsable hosts
/16255.255.0.065,53665,534
/20255.255.240.04,0964,094
/22255.255.252.01,0241,022
/24255.255.255.0256254
/26255.255.255.1926462
/27255.255.255.2243230
/28255.255.255.2401614
/29255.255.255.24886
/30255.255.255.25242
/31255.255.255.25422 (point-to-point)
/32255.255.255.25511 (single host)
  • Network address is the first address and names the subnet. In IPv4 the broadcast address is the last one. Neither is a host.
  • Usable hosts are the total minus those two, except for /31 (RFC 3021) and /32, where the rule changes.
  • IPv6 has no broadcast address. The calculator takes off only the first address of the subnet, which is reserved as the subnet-router anycast address (RFC 4291 section 2.6.1). A /64 shows 18,446,744,073,709,551,615 usable out of 18,446,744,073,709,551,616. On a /127 both addresses count, and a /128 is a single host.
  • Wildcard mask is the netmask inverted, as used in Cisco access lists and OSPF network statements.
  • Host bits set. If you type 10.0.0.77/24, the calculator tells you the network is 10.0.0.0/24 and notes that your address had host bits set.
  • Reverse DNS zone. It is shown when the prefix falls on an octet (IPv4) or hex digit (IPv6) boundary. For IPv4 blocks that do not, the result points you to RFC 2317.
  • Classes (A to E) are shown for reference only. CIDR replaced classful addressing in 1993.

Common mistakes

  • Assigning the network or broadcast address to a host. In a /24, .0 and .255 are not usable.
  • Counting cloud subnets like physical ones. AWS and Azure reserve five addresses per subnet and Google Cloud reserves four, so a /28 with 14 usable hosts on paper has 11 in AWS.
  • Using a /64 for a point-to-point link. It works, but it leaves the link open to neighbour-discovery exhaustion, where a flood of lookups fills a router's tables, so RFC 6164 recommends /127 for router-to-router links.
  • Using anything other than a /64 for a SLAAC LAN. SLAAC, the way IPv6 devices configure their own addresses, expects 64 host bits.
  • Overlapping subnets. Split the parent into equal pieces and allocate from the list, and nothing overlaps. For uneven needs, allocate the largest subnet first.
  • Confusing masks. A netmask is ones from the left, then zeros, like 255.255.255.192, and a wildcard is the reverse. A mask with gaps, such as 255.0.1.0, is neither and is rejected.

How it is calculated

Addresses are parsed into exact integers (BigInt for IPv6). The prefix length defines a mask of that many leading ones, and the network is the address ANDed with the mask. The last address is the network ORed with the inverted mask. Total addresses are two raised to the number of host bits, usable hosts follow the rules above, and the address type is matched against the IANA special-purpose registries. No floating-point maths is involved, so large IPv6 counts are exact.

For a range that does not line up with a single block, use the range to CIDR converter. To shorten or spell out a long IPv6 address, see IPv6 compress and IPv6 expand.

Standards

  • RFC 4632: classless inter-domain routing (CIDR). RFC 950: the original subnetting standard.
  • RFC 3021: /31 point-to-point links in IPv4. RFC 6164: /127 links in IPv6.
  • RFC 4291: IPv6 addressing, including the 64-bit interface identifier and the subnet-router anycast address.
  • RFC 2317: reverse DNS for blocks that do not fall on an octet boundary.
  • RFC 1918, RFC 6598, RFC 5737, RFC 6890: private, shared, documentation and special-purpose ranges.

Questions people ask

How many usable hosts are in a /24?

A /24 has 254 usable hosts. It holds 256 addresses, and the first is the network address while the last is the broadcast address, which leaves 254 for hosts. Every step down in prefix length doubles the count, so a /23 has 510 and a /25 has 126.

What is the difference between a subnet mask and a wildcard mask?

They are inverses of each other. As a subnet mask, 255.255.255.0 marks the network part. As a wildcard, 0.0.0.255 marks the host part, which is the form many router access lists expect. The calculator shows both for every IPv4 network, and accepts either one in place of a prefix length.

Why does AWS give me fewer addresses than the calculator says?

AWS reserves five addresses in every subnet: the network address, the VPC router, the DNS server, one held for future use and the broadcast address. Azure also reserves five and Google Cloud four. Choose the provider under More options to see the real count for each subnet.

How do I split a network into smaller subnets?

Choose a longer prefix than the network has. Splitting a /24 into /26 subnets gives four, each with 62 usable hosts. Every extra bit in the prefix doubles the number of subnets and halves their size, and you can page through large splits 256 rows at a time.

Why does a /31 have two usable addresses?

On a point-to-point link there is no need for a network or broadcast address, so both addresses can be used by the two routers. RFC 3021 allows this for IPv4 /31 networks, and the calculator counts them that way. RFC 6164 does the same for IPv6 /127 links.

Does it handle IPv6?

Yes. Enter any IPv6 prefix and you get the exact size, the first and last address and the reverse DNS zone. IPv6 has no broadcast address, so on an ordinary subnet the only address taken off the usable count is the first one, the subnet-router anycast address.

Is anything sent to your servers?

Yes. The calculation runs on our server, whether you use the web page, the API or an AI assistant. The input is not written to logs and is held in memory for at most a day. On the website, Google Analytics also records what you enter, so see the privacy policy for the details and how to opt out.

Use it from AI, the API or the command line

Every LookupOwl tool is also a free API and an MCP tool, with no key and no account. This one is subnet_calculate. Please be kind to the rate limits.

curl
curl "https://lookupowl.com/api/v1/tools/subnet-calculator?q=10.0.0.0%2F22"
MCP
claude mcp add --transport http lookupowl https://lookupowl.com/mcp