Skip to content

Subnet Calculator

Including the /31 and /32 that most calculators get wrong.

Work out the network address, broadcast, usable host range and mask for any IPv4 address and prefix, split a block into subnets, and size one to a host count.

Written and maintained by Mohit PatelLast checked August 4, 2026How we build these

Try one of these

How big a subnet do I need?

A /26 — mask 255.255.255.192, holding 62 usable addresses.

Network192.168.1.128/2662 usable hosts of 64 addresses
Subnet mask
255.255.255.192
Wildcard mask

The inverse, which is what an ACL or an OSPF statement wants

0.0.0.63
Network address

Not assignable to a host

192.168.1.128
Broadcast address

Not assignable to a host

192.168.1.191
First usable host
192.168.1.129
Last usable host
192.168.1.190
Total addresses
64
Usable hosts
62
Legacy class

Classful addressing ended in 1993 with CIDR. Kept because exams still ask

C

Private address

RFC 1918, and the range almost every home router uses.

Split this /26 into smaller subnets

4 subnets of 14 usable hosts each.

The subnets this block divides into
NetworkFirst hostLast hostBroadcast
192.168.1.128/28192.168.1.129192.168.1.142192.168.1.143
192.168.1.144/28192.168.1.145192.168.1.158192.168.1.159
192.168.1.160/28192.168.1.161192.168.1.174192.168.1.175
192.168.1.176/28192.168.1.177192.168.1.190192.168.1.191

All of this is exact arithmetic on 32 bits, done in the browser. One detail worth knowing if you ever write it yourself: JavaScript’s bitwise operators are signed, so any address above 127 in the first octet comes back negative unless every step ends in an unsigned shift. It is the reason a surprising number of home-made subnet tools work perfectly on 192.168 and fall apart on 200.100.

How the Subnet Calculator works

Exact arithmetic on 32 bits, with the two edge cases most calculators fail. A /31 has two usable addresses under RFC 3021, not zero, and it is the configuration on a great many point-to-point links. A /32 is one host, not minus one.

Also known as: cidr calculator · ip subnet calculator · subnet mask calculator · network address calculator · cidr to subnet mask

Frequently asked questions

How many usable hosts are in a subnet?

Two to the power of the host bits, less two for the network and broadcast addresses — so a /24 holds 254 and a /26 holds 62. The exceptions are the ones that matter: a /31 has two usable addresses under RFC 3021 because a point-to-point link has two ends and needs no broadcast, and a /32 is a single host. Applying the general formula to those gives zero and minus one, which is how you spot a calculator that has not thought about it.

What is a /31 for?

Router-to-router links. Before RFC 3021 the smallest sensible block for a point-to-point connection was a /30, which spends four addresses to use two. A /31 assigns both of its addresses to hosts, halving the waste, and every current router platform supports it. On a backbone with thousands of links that saving is substantial.

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

They are inverses. A subnet mask such as 255.255.255.192 marks the network bits with ones; the wildcard 0.0.0.63 marks the host bits instead. Cisco access lists and OSPF network statements take the wildcard, which is why typing a subnet mask into an ACL silently matches the wrong thing rather than erroring.

Which address ranges are private?

Three, from RFC 1918: 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. The middle one is the one people misremember — it covers 172.16 through 172.31 only, so 172.15 and 172.32 are ordinary public addresses belonging to somebody else. Also worth knowing is 100.64.0.0/10, carrier-grade NAT space, which is neither private nor public and shows up on mobile and some fibre connections.

Are IP classes still used?

No. Classful addressing ended in 1993 when CIDR replaced it, and a modern network is defined by its prefix rather than by whether its first octet happens to be under 128. The class is shown here because certification exams still ask about it, not because anything routes that way.

Why is 255.255.0.255 not a valid subnet mask?

Because a mask has to be an unbroken run of ones followed by an unbroken run of zeros. Non-contiguous masks were legal in the classful era and are not now, and no current equipment will accept one. It is rejected here rather than being silently interpreted, since any answer derived from it would be meaningless.

Related calculators