esc
No tool matches that yet.
  1. Home
  2. Network tools
  3. Subnet calculator

Subnet calculator

Type an address with a prefix, mask or wildcard and get the network, broadcast and usable host range instantly — then split it, plan VLSM, convert ranges to CIDR, summarise routes or check whether an address is inside a subnet. IPv6 included, with exact 128-bit maths.

Try:

Network

Formats & reverse DNS

Binary view

network bits host bits
Subnet mask cheat sheet — /0 to /32
PrefixSubnet maskWildcardAddressesUsable hostsPer /24

Click a row to apply that mask to the address above.

Every calculation runs in your browser with exact 128-bit arithmetic. Nothing is sent anywhere.Results checked against Python’s ipaddress module.

How to read the results

A subnet is an address plus a prefix length — the number of leading bits that identify the network. In 192.168.1.10/24 the first 24 bits (192.168.1) are the network and the last 8 bits identify a device. The calculator shows every derived value:

  • Network address — all host bits set to 0. It names the subnet and is not given to a device.
  • Broadcast address — all host bits set to 1. Packets sent to it reach every device on the subnet.
  • First and last usable host — everything in between. Home routers usually take the first (.1) as the gateway; BT Smart Hubs use 192.168.1.254, the last.
  • Subnet mask — the prefix written as four numbers: /24 is 255.255.255.0.
  • Wildcard mask — the mask inverted (0.0.0.255), used by Cisco ACLs and OSPF network statements. You can type a wildcard straight into the box and it is recognised.

The binary view is the quickest way to understand why the numbers come out as they do: the vertical bar marks where the prefix ends, network bits are shaded one colour and host bits another. Anything that is not an ordinary public address is labelled — RFC 1918 private ranges, 100.64.0.0/10 carrier-grade NAT (which is why some UK mobile and fibre customers cannot port-forward), 169.254.0.0/16 link-local (a sign DHCP failed), documentation ranges and multicast blocks.

Usable hosts, /31 and /32 — the edge cases other calculators get wrong

For most prefixes the usable host count is 232−prefix − 2, because the network and broadcast addresses are reserved. Two prefixes break that rule:

PrefixAddressesUsableWhy
/3042The classic router-to-router link: one network, two hosts, one broadcast.
/3122RFC 3021 point-to-point link: no broadcast is needed between two routers, so both addresses are hosts. Supported by Cisco IOS, Juniper, MikroTik and Linux.
/3211A host route or loopback address — the single address is the host.

Many calculators show “0 usable hosts” for /31 and /32, which is wrong for modern networks. The VLSM planner has an option to give two-host links a /31 and halve the address space those links consume.

IPv6 has no broadcast address at all, so every address in a prefix is usable. The one convention to know is that a normal LAN is always a /64: SLAAC, privacy addresses and EUI-64 all assume 64 host bits. UK ISPs typically hand home customers a /56 (256 LANs) or a /48, and the IPv6 tab tells you how many /64s any prefix contains.

Splitting a network and planning VLSM

To divide 192.168.0.0/24 into four, borrow two host bits: each subnet becomes a /26 with 62 usable hosts. Subnets always come in powers of two, so asking for five gives you eight /27s — the calculator tells you when it rounds up. You can also split by the hosts you need in each subnet or by a target prefix, and it works for IPv6 (split a /48 into /64s, or a /56 into /60s). Up to 65,536 rows can be copied or exported as CSV.

VLSM (variable-length subnet masking) is how real networks are planned: an office LAN, a guest Wi-Fi, a CCTV VLAN for Hikvision cameras and a router link all need different sizes. List each subnet with the hosts it needs; the planner rounds each up to the smallest block that fits, places the largest first so every block stays aligned on its own boundary, and lists what is left as free CIDR blocks for later growth. If the plan cannot fit it tells you the smallest parent network that would.

  1. Enter the parent network, e.g. 10.10.0.0/22.
  2. Choose VLSM by hosts and type one line per subnet: Office 200.
  3. Copy the table or download the CSV straight into your IP plan.

CIDR to range, range to CIDR and route summarisation

Firewalls, cloud security groups and allow-lists often need CIDR blocks, while suppliers hand you a start and end address. The Range ↔ CIDR tab converts both ways: a block becomes its first and last address, and an arbitrary range such as 10.0.0.5 – 10.0.1.20 becomes the minimal list of CIDR blocks that covers exactly that range, nothing more. It also gives the single covering block and how many extra addresses it would let in, so you can decide whether the shortcut is acceptable.

Summarise accepts any mix of addresses, blocks and ranges — pasted from a router config, a spreadsheet or a log — and merges overlapping and adjacent entries into the shortest equivalent list, the same result as Python’s collapse_addresses. The summary route (supernet) is what you would advertise upstream in BGP or configure as a static route. The IP in subnet? tab answers the everyday question “is this address covered by that rule?” for whole lists at once, marking the most specific match. To find the public address you are using right now, see what is my IP address; to identify a device from its hardware address, use the MAC address lookup.

Accuracy, privacy and limits

All maths uses JavaScript BigInt, so a /0 IPv6 prefix with 2128 addresses is counted exactly rather than rounded. The results have been cross-checked against Python’s standard ipaddress module across about 9,600 random and edge cases — networks, broadcasts, host ranges, RFC 5952 compressed forms, reverse-DNS names, range-to-CIDR, collapsing and splitting. IPv6 addresses are shown in RFC 5952 canonical form (lower-case, longest zero run compressed), with IPv4-mapped addresses written as ::ffff:192.0.2.1. Nothing you type leaves your browser. For more network tools, see the network tools section.

Frequently asked questions

How many usable hosts are in a /24, /26 or /30?

A /24 has 256 addresses and 254 usable hosts; a /25 has 126; a /26 has 62; a /27 has 30; a /28 has 14; a /29 has 6; and a /30 has 2. The general rule is 2 to the power of the host bits, minus two for the network and broadcast addresses. A /31 is the exception with 2 usable hosts on point-to-point links, and a /32 is a single host.

What is a wildcard mask and how do I convert it?

A wildcard mask is the subnet mask with every bit flipped, so 255.255.255.0 becomes 0.0.0.255. Cisco access lists and OSPF network statements use it to say which bits must match. Subtract each octet of the mask from 255 to convert. This calculator shows the wildcard for every subnet and also accepts a wildcard as input — type 10.0.0.0 0.0.0.63 and it is read as /26.

Can a /31 subnet really be used?

Yes. RFC 3021 allows /31 prefixes on point-to-point links between two routers, where no broadcast address is needed, so both addresses are assigned to interfaces. It halves the address space used by router links compared with a /30. Cisco, Juniper, MikroTik, Arista and Linux all support it. Do not use a /31 on an ordinary LAN with several devices.

Why can’t I split a network into exactly five subnets?

Subnetting works by borrowing host bits, and each extra bit doubles the number of subnets, so equal subnets always come in powers of two: 2, 4, 8, 16. Asking for five gives eight subnets of the same size and you simply leave three unused. If you need five subnets of different sizes, use the VLSM planner, which sizes each one to its host count.

How many /64 subnets are in a /48 or a /56?

A /48 contains 65,536 /64 subnets and a /56 contains 256. Because every IPv6 LAN is a /64, those numbers are how many separate networks you can build. Most UK ISPs that offer IPv6 hand home customers a /56 or /48 through DHCPv6 prefix delegation. The IPv6 tab shows the /64, /56 and /48 counts for any prefix you enter.

What does 100.64.0.0/10 mean on my router?

It is carrier-grade NAT shared address space (RFC 6598). If your router’s WAN address falls inside 100.64.0.0 to 100.127.255.255, your provider shares one public IPv4 address between many customers. That is common on mobile broadband and some fibre networks, and it means incoming port forwarding for game servers or CCTV will not work unless your ISP offers a public or static IP.

Is the network address or broadcast address usable for a device?

Not on an ordinary IPv4 subnet of /30 or larger. The network address identifies the subnet and the broadcast address reaches every device on it, so giving either to a host causes problems. The calculator warns you if the address you typed is one of them. On /31 point-to-point links and /32 host routes the rule does not apply, and IPv6 has no broadcast address.

Network tools