1. Home
  2. Developer tools
  3. Subnet Calculator

Subnet Calculator

Type an address such as 192.168.1.130/26 or 10.0.0.5 255.255.255.0 and see everything about the subnet it sits in. IPv6 prefixes work too, and any block can be split into smaller subnets.

Free, no sign-up. Runs in your browser: nothing is uploaded.

How to use Subnet Calculator

  1. Enter an address with a prefix length or a netmask.
  2. Read the network, broadcast, usable range and counts.
  3. Choose a longer prefix to list the subnets inside the block.

Features

  • IPv4 and IPv6 in one box
  • Accepts /prefix or a dotted netmask
  • Network, broadcast, first and last host, wildcard mask
  • Shows the address in binary with the network bits marked
  • Splits a block into equal subnets
  • Handles /31 and /32 as the standards define them

Supported formats

Input

  • IPv4 address with CIDR or mask
  • IPv4 addresses
  • Typed or pasted text

You get

  • Network and broadcast address
  • Host range
  • Subnet table

Private by design

Everything you enter is processed by your browser on this device. Nothing is sent to openWorkstand or anyone else, so the Subnet Calculator is safe for private and work data. After you have used it once while online, it also works without an internet connection. How local processing works

Good to know

  • IPv6 prefixes get a shorter result (first and last address, count and /64 subnets), because IPv6 has no broadcast address or host count to subtract.
  • A /31 and a /32 are shown as point-to-point and single-host networks (RFC 3021) rather than with the usual two reserved addresses.
  • Only the first 64 subnets of a split are listed.

Guide

Working out an IPv4 subnet from an address and a prefix

Anyone who has set up a router, a VLAN or a cloud network has met the question “which addresses belong together?”. A subnet calculator answers it from two inputs: an address and either a prefix such as /26 or a mask such as 255.255.255.192. The page returns the network address, broadcast address, the range of usable hosts, the wildcard mask and a few facts that help when you are reading a design or checking a classmate’s homework.

How the arithmetic works

An IPv4 address is 32 bits. The prefix length says how many of the leading bits name the network; the rest number the hosts. The calculator turns the prefix into a mask (26 ones followed by 6 zeros) and performs a bitwise AND with the address. That gives the network address, the lowest value in the block. Setting every host bit to 1 gives the broadcast address, the highest value. Everything strictly between the two is available for hosts. The prefix notation itself is standardised in RFC 4632.

Reading the result

The output lists the network in CIDR form, the dotted mask, the wildcard mask (the mask inverted, used by Cisco-style access lists), the broadcast address, the first and last usable host, the number of addresses in the block and the number of usable hosts. Two further lines are easy to overlook. “Address class” is historic: classes A, B and C were dropped in 1993 when classless addressing arrived, but exam questions and some documentation still use them. “Kind of address” tells you whether the block is private (RFC 1918), shared carrier-grade NAT space, loopback, link-local, documentation or ordinary public space.

Edge cases that surprise people

A /31 has only two addresses, and the usual rule of subtracting two would leave none. RFC 3021 lets both be used on a point-to-point link, so the calculator reports two usable hosts and no broadcast. A /32 is one address, used for loopbacks and host routes. If you type a host address instead of a network address, the tool does not complain; it shows the block that the host belongs to and says so, which is exactly what you want when you only know a device’s address and prefix. Masks that are not contiguous, such as 255.0.255.0, are rejected because they are not valid subnet masks.

A worked example

Take 192.168.1.130/26. The mask is 255.255.255.192 and the last octet of the mask is 11000000. The address’s last octet, 130, is 10000010; ANDing leaves 10000000, which is 128. So the network is 192.168.1.128/26, the broadcast address is 192.168.1.191 (the last octet becomes 10111111), the usable range is 192.168.1.129 to 192.168.1.190, and the block holds 64 addresses of which 62 are usable. The wildcard mask is 0.0.0.63. The page also marks the block as private under RFC 1918 and offers to split it: choosing /27 gives two subnets, /28 gives four, and so on down to /32.

Limits

IPv6 prefixes are accepted too, but they get a shorter answer (first and last address, the size of the block and how many /64 networks it holds), because IPv6 has no broadcast address and nobody counts hosts in a /64; the IPv6 Subnet Calculator goes further with prefix planning. A split lists only the first 64 subnets. The page is pure arithmetic. It cannot tell whether an address is in use, whether a router is configured correctly or whether two blocks overlap on your real network. When you must fit subnets of different sizes into one block, the VLSM Calculator does the allocation for you.

Checked against the current version of the Subnet Calculator on .

Frequently asked questions

Why does a /24 have 254 usable hosts and not 256?

Two of the 256 addresses are reserved: the lowest is the name of the network and the highest is the broadcast address that reaches every host. That leaves 254 for devices, and the same subtraction of two applies to every prefix up to /30.

What is the difference between a subnet mask and a prefix length?

They say the same thing in two notations. The mask 255.255.255.192 has 26 leading one bits, so it is written /26; the prefix is just the count of those bits, which is shorter to type and easier to compare.

How many usable hosts does a /26 have?

A /26 has 64 addresses. The first is the network address and the last is the broadcast address, so 62 can be given to hosts.

Why does a /31 show two usable hosts?

RFC 3021 allows /31 on point-to-point links, where neither a network nor a broadcast address is needed. Both addresses are usable.

Keep working with the result

openWorkstand also includes a free workspace with documents, spreadsheets, tasks, projects and a calendar that save to a folder on your computer.