Network

Subnet & CIDR Calculator

CIDR math for IPv4 and IPv6 — network, broadcast, first/last host, subnet mask, and total addresses.

Subnet calculator

Enter a CIDR — IPv4 or IPv6 — to see the network and host range.

All math runs in the browser. Examples: 10.0.0.0/24, 192.168.1.5/30, 2001:db8::/32.

Results

Sample Live example: the 192.168.1.0/24 block. Enter your own CIDR above to replace it.

IPv4192.168.1.0/24/248 host bit(s)
Network
192.168.1.0
Broadcast
192.168.1.255
First host
192.168.1.1
Last host
192.168.1.254
Netmask
255.255.255.0
Wildcard mask
0.0.0.255
Total addresses
256
Usable hosts
254

Practical guide

How to use the subnet calculator

Subnetting is the part of networking everyone re-derives every few months. This calculator and the explanations below take the guesswork out of the math whether you are sizing a VPC, allocating a customer block, or studying for a certification.

What this tool checks

Enter any IPv4 or IPv6 address in CIDR notation — for example 10.0.0.0/24 or 2001:db8::/32 — and the calculator returns the network address, broadcast address, usable host range, total addresses, and the equivalent subnet mask. It accepts both classful and classless inputs and normalizes them into their canonical form.

When to use it

Use it before assigning a new VPC or VLAN, when planning a network migration, while answering certification practice questions, when troubleshooting a route that is supposed to cover an entire subnet, or when handing a block to a customer and you need the exact host range that fits inside the prefix. It is also useful for sanity-checking an existing setup — paste in the subnet and confirm the broadcast is what you expected.

How to read the result

The network address is the first address in the block and identifies the subnet itself. The broadcast address is the last and is reserved in IPv4. Everything in between is assignable. The mask (or prefix length) tells routers and operating systems how to split incoming addresses into network and host portions. Total addresses is 2^(32 − prefix) for IPv4 and 2^(128 − prefix) for IPv6.

Common errors and what they mean

If the calculator complains that the address does not match the prefix, the host bits are non-zero — for example, 192.168.1.5/24 is really inside 192.168.1.0/24 and the calculator will normalize. A /33 or larger for IPv4 is invalid because IPv4 addresses are 32 bits. For IPv6, you cannot exceed /128. Subnets larger than /24 (smaller prefix number) in IPv4 cross what used to be class-B boundaries and behave the same way today.

IPv4 CIDR quick reference

The prefix lengths you will reach for most often, with their mask and host counts. Usable counts assume standard IPv4 (network and broadcast reserved).

PrefixSubnet maskTotal addressesUsable hosts
/30255.255.255.25242
/29255.255.255.24886
/28255.255.255.2401614
/27255.255.255.2243230
/26255.255.255.1926462
/24255.255.255.0256254
/16255.255.0.065,53665,534

Field notes

Two mistakes account for most subnet confusion. First, host bits set in the input — 192.168.1.5/24 is not a network, it is a host inside 192.168.1.0/24; the calculator normalizes it, but your router config might not. Second, off-by-one on usable hosts: a /30 gives you 2 usable, not 4. When in doubt, size up one prefix rather than running out of addresses a year later.

Example: planning a /28 for a small VLAN

Example input
10.50.10.0/28
Example result
Network:   10.50.10.0
Broadcast: 10.50.10.15
Host range: 10.50.10.1 — 10.50.10.14
Mask:      255.255.255.240
Total:     16  (14 usable)

A /28 is a common size for a small server VLAN: 14 usable hosts is enough for a rack of appliances plus a gateway and reserved address, without burning a full /24.

Related tools

Related guides

FAQ

What does a /24 mean in CIDR notation?
The number after the slash is the prefix length — how many bits at the start of the address belong to the network. A /24 has 24 network bits and 8 host bits, which gives 256 total addresses (254 usable in IPv4 once you subtract the network and broadcast). /16 is 65,536 addresses, /28 is 16. The full cheat sheet lives in the Subnetting for Beginners guide.
Why does the calculator subtract two addresses in IPv4 but not in IPv6?
In IPv4 the first address in a subnet is the network address and the last is the broadcast — neither can be assigned to a host. IPv6 dropped broadcast entirely (it uses multicast instead) and the all-zeros address is reserved but the all-ones is usable. For IPv6 the calculator reports the full range as the host range.
What is the difference between a netmask and a CIDR prefix?
They express the same thing two different ways. A /24 prefix is the same as the netmask 255.255.255.0. CIDR notation is shorter and is what every router, cloud console, and modern config file expects today. Older systems still accept dotted-decimal netmasks and the calculator shows both.
Can I split a /24 into smaller subnets here?
The current calculator solves one subnet at a time — give it a CIDR block and it returns the network address, broadcast, host range, and total addresses. To plan VLSM (variable-length subnet masks) by hand, work in binary or use the cheat sheet in the Subnetting for Beginners guide. A built-in VLSM splitter is on the roadmap.
Is /31 really usable for point-to-point links?
Yes — RFC 3021 defines /31 as a valid two-address subnet for point-to-point links between routers, with neither address reserved. /32 is used for a single-host route, typically on a loopback interface. The calculator handles both correctly and will report 2 usable hosts for /31.
How many usable hosts are in a /26?
A /26 has 64 total addresses and 62 usable in IPv4, because the network and broadcast addresses are reserved. The pattern is 2^(32 − prefix) total, minus 2 usable: /27 is 32 total / 30 usable, /28 is 16 / 14, /29 is 8 / 6. IPv6 does not reserve a broadcast address, so the math differs.
What is the broadcast address and why can't I assign it?
The broadcast address is the last address in an IPv4 subnet (all host bits set to 1). Traffic sent to it reaches every host on the subnet, so it cannot be assigned to a single device. The first address (all host bits 0) is the network identifier and is likewise reserved. That is why a /24 has 256 addresses but only 254 usable hosts.

Last reviewed: 2026-06-25.