elefcode

Subnet Calculator

Network, broadcast, mask and host range for any IPv4 or IPv6 block — plus a VLSM planner and CIDR merge tool.

Prefix/24

Network

Network192.168.1.0/24
Netmask255.255.255.0
Wildcard mask0.0.0.255
Broadcast192.168.1.255
First host192.168.1.1
Last host192.168.1.254
Total addresses256
Usable hosts254

Address

ScopePrivate (RFC 1918)
ClassC
IPv4-mapped IPv6::ffff:192.168.1.130
Hex0xC0A80182
Integer3232235906
Reverse DNS (PTR)130.1.168.192.in-addr.arpa
Reverse zone1.168.192.in-addr.arpa

192.168.1.130 is a host inside 192.168.1.0/24. Use when you mean the whole network — routers and cloud consoles reject host bits in a CIDR.

Binary

11000000.10101000.00000001.10000010

Blue bits are the network part (the first 24); grey bits identify a host.

Is an address in this network?

Split into smaller subnets

Advertisement

Guide

About the Subnet Calculator

A subnet calculator answers the question every network change starts with: given this address and this prefix, which addresses are actually in the block? Enter something like 192.168.1.130/24 and you get the network address, the broadcast, the first and last usable host, and how many hosts fit.

It accepts CIDR notation, a dotted netmask (10.0.0.1 255.255.255.0), a Cisco wildcard mask, a range (10.0.0.5 - 10.0.0.77) or a bare address, and handles IPv6 as well as IPv4. Two more tabs plan subnets by host count and merge or subtract lists of CIDR blocks.

What the prefix actually means

The number after the slash is how many bits belong to the network. A /24 fixes the first 24 bits, leaving 8 bits for hosts — so 256 addresses, of which 254 are usable once the network and broadcast addresses are set aside. Every bit you add to the prefix halves the block. The binary view on this page shows exactly where that boundary falls, which is usually the clearest way to see why an address is or is not in a subnet.

Why usable hosts is two fewer

In a normal IPv4 subnet the first address identifies the network itself and the last is the broadcast address, so neither can be assigned to a machine. That is where the "minus two" comes from. There are two exceptions this calculator handles: a /32 is a single host route with no network or broadcast, and a /31 is a point-to-point link where both addresses are usable, as defined in RFC 3021.

Netmask, wildcard, and where each is used

The netmask (255.255.255.0) marks network bits with ones. The wildcard mask is its exact inverse (0.0.0.255) and is what Cisco access lists and OSPF statements expect. They carry the same information inverted, which is why mixing them up is such a common and confusing mistake.

Splitting a block

Choosing a longer prefix splits the block into equal subnets — a /24 divides into four /26s, each with 62 usable hosts. This is the usual way to carve an allocation into per-VLAN or per-environment ranges. When the subnets need different sizes, use the Subnet planner tab instead: list each network and its host count, and it assigns the smallest block that fits each one, largest first, so nothing overlaps and the leftover space is reported as clean CIDR blocks.

Ranges, merging and exclusions

Firewalls, cloud security groups and route tables want CIDR blocks, but address lists often arrive as ranges or as dozens of overlapping entries. The Merge, exclude & ranges tab turns ranges into the minimal set of blocks, joins adjacent and overlapping ones, and can cut exceptions out — for example everything in 10.0.0.0/8 except one subnet.

IPv6 differences

IPv6 has no broadcast address and no reason to reserve the first and last address, so every address in a prefix is usable. Allocations are also enormous: a single /64 holds about 18 quintillion addresses, and /64 is the standard size for one network segment. The calculator shows both the compressed form (RFC 5952) and the fully expanded form, how many /64s a prefix holds, the ip6.arpa reverse zone, any embedded IPv4 address (mapped, 6to4, NAT64), and the MAC address behind an EUI-64 interface ID.

How to use it

  1. 1Type an address with a prefix, such as 10.0.0.0/8 — or paste an address and netmask separated by a space.
  2. 2Read the network, broadcast, and usable host range.
  3. 3Check the binary view to see exactly where the network boundary sits.
  4. 4Pick a longer prefix to split the block into equal subnets, and copy or download the list.
  5. 5For different-sized subnets, switch to the planner; for lists of ranges, use Merge.

Frequently asked questions

How many usable hosts are in a /24?

254. A /24 contains 256 addresses, but the first is the network address and the last is the broadcast address, so neither can be assigned to a host.

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

They are exact inverses. A netmask like 255.255.255.0 marks network bits with ones; the wildcard 0.0.0.255 marks host bits with ones. Cisco ACLs and OSPF use wildcard masks.

Why does a /31 show two usable hosts?

RFC 3021 allows /31 on point-to-point links, where there is no need for a network or broadcast address, so both addresses can be assigned.

Does this work for IPv6?

Yes. Enter something like 2001:db8::/32 and you get the network, first and last address, total count, number of /64s, scope, reverse zone, and both the compressed and expanded forms. Addresses with an embedded IPv4 part such as ::ffff:192.0.2.1 work too.

How do I convert an IP range to CIDR?

Type the range with a dash, e.g. 10.0.0.5 - 10.0.0.77. The calculator lists the fewest CIDR blocks that cover exactly that range.

What is VLSM?

Variable-length subnet masking: giving each network a subnet sized to its needs instead of equal splits. The planner tab does it for you — enter the block and the host count of each network.

Why does 203.0.113.9 say “Documentation”?

192.0.2.0/24, 198.51.100.0/24 and 203.0.113.0/24 (and 2001:db8::/32 in IPv6) are reserved for examples and documentation and are never routed on the internet. The scope line flags these and the other special-purpose ranges.

Is my data sent anywhere?

No. All the arithmetic happens in your browser and nothing is uploaded or logged. Your last input is remembered in this browser only.

Learn more