%3C/text%3E%3C/svg%3E">
💻
💻 Tech & IT

IPv4 Subnet Calculator (CIDR, mask, hosts, range)

Results update as you type.

Your numbers

Understanding the IPv4 subnet calculator — concept and principle

An IPv4 subnet calculator takes one address and a prefix length (the "/n" in CIDR notation) and tells you which network that address belongs to: the network address, subnet mask, wildcard mask, broadcast address, the range of addresses you can assign to devices, and how many there are. It is used when planning address ranges, writing firewall rules, configuring DHCP scopes and troubleshooting connectivity.

How a /26 mask splits 192.168.10.3737 AND 192 = 0, so the address sits in 192.168.10.0/26: network .0, usable hosts .1 to .62, broadcast .63./26: the first 26 bits are the network192168103724 bits: networklast octet, bit by bitIP 3700100101mask 19211000000AND00000000= 02 net bits6 host bits → 2⁶ = 64.0.64.128.192.37network.062 hosts.1 – .62broadcast.63
With /26 the last octet keeps 6 host bits: 64 addresses, of which 62 can be given to devices.

How it is calculated

An IPv4 address is a 32-bit number written as four decimal octets. The prefix length n says how many leading bits identify the network.

The principle

Routers forward traffic by comparing only the network bits. Every address that shares the same first n bits is "on-link" and reachable without a router. The all-zeros host pattern names the network itself and the all-ones pattern is the directed broadcast, so in a normal subnet those two are reserved, which is where the "− 2" comes from. Subnet sizes are therefore powers of two, and each subnet starts on a multiple of its size.

Worked example

  1. Inputs: IP 192.168.10.37, prefix /26.
  2. Mask: 26 ones = 255.255.255.192 (last octet 11000000).
  3. Last octet of the IP: 37 = 00100101. 37 AND 192 = 0, so the network is 192.168.10.0/26.
  4. Wildcard: 0.0.0.63. Broadcast: 0 OR 63 = 192.168.10.63.
  5. Usable range: 192.168.10.1 – 192.168.10.62, which is 2^6 − 2 = 62 hosts.
  6. First octet 192 is class C, and 192.168.0.0/16 is private, so the row reads C · private (RFC 1918).

How to read the result

Two hosts talk directly only if they compute the same network address. A /24 gives 254 hosts, /26 gives 62, /28 gives 14 and /30 gives 2. The gateway must be a usable address, usually the first or last.

Common mistakes

Keep in mind: This is address arithmetic only. Real networks also depend on routing, VLANs and provider rules, so verify device configuration before changing a live network.

Frequently asked questions

Why does a /26 have 64 addresses but only 62 hosts?

The first address identifies the network and the last is the broadcast address, so neither is assigned to an interface.

Are classes A, B and C still used?

Not for routing. Since CIDR any prefix length is allowed; class names survive as shorthand for /8, /16 and /24.

Sources: IETF RFC 4632, Classless Inter-domain Routing (CIDR) · IETF RFC 1918, Address Allocation for Private Internets · IETF RFC 3021, Using 31-Bit Prefixes on IPv4 Point-to-Point Links

Checked 8 Nov 2026. Standard formulas and RFC/IEEE definitions, computed locally in your browser — nothing you type is sent anywhere.

</> Add this calculator to your website (free)

Copy this code into your blog or site. It is free to use; please keep the credit link.

Preview
💻 All tech & IT tools →🌍 Calculators by country →