Skip to content

Subnet Calculator

Expands a CIDR block into network, broadcast, usable range and host count, for IPv4 and IPv6.

Expands a CIDR block into every fact about it, splits one into subnets, summarises several into the smallest block that holds them, and converts between an address range and the prefixes that cover it. IPv6 is the same code path as IPv4 rather than an afterthought, so a /48 expands as readily as a /24.

🔒 Runs entirely in your browsersubnetcidripv4ipv6calculator

A prefix length or a dotted netmask both work, and a bare address is treated as a single host.

Network

192.168.1.0

Netmask

255.255.255.0

Wildcard mask

0.0.0.255

What an ACL wants instead of a netmask.

Broadcast

192.168.1.255

First usable

192.168.1.1

Last usable

192.168.1.254

Total addresses

256

Usable

254

The network and broadcast addresses are not assignable.

Prefix

/24

This block is registered

  • 192.168.0.0/16Private useRFC 1918Not routable on the internet

Reverse DNS zone

1.168.192.in-addr.arpa

Decimal

3232235776

Hexadecimal

0xc0a80100

Binary

11000000.10101000.00000001.00000000

PTR name

0.1.168.192.in-addr.arpa

Other spellings a browser will accept
  • 3232235776
  • 0xc0a80100
  • 192.11010304
  • 0300.0250.01.00

Every one of these resolves to the same address in most network stacks. It is why a filter that checks whether a string starts with "127." is not a loopback check.

All of this is arithmetic on the address, done in this page. Nothing is looked up and nothing is sent — an internal addressing plan is exactly the sort of thing that should not be typed into someone else’s server.

How to use it

  1. Type the block in any form you have it

    192.168.1.0/24, 192.168.1.0/255.255.255.0, or a bare address treated as a single host. An address with host bits set is accepted and the block it belongs to is named.

  2. Read usable apart from total

    IPv4 loses the network and broadcast addresses; a /31 does not, because RFC 3021 makes both usable on a point-to-point link. The line under the number says which rule applied.

  3. Use summarise before you write a firewall rule

    It gives the smallest single block covering everything you listed, and the count of addresses it swallows that you did not ask for. That second number is the one that turns a tidy rule into an open door.

  4. Convert a range when a form wants CIDR

    A range that does not begin and end on power-of-two boundaries needs several prefixes; the tool gives the fewest that cover it exactly, and the reverse direction gives the span a set of blocks covers.

Common questions

Is anything sent when I type an internal plan?

No. It is arithmetic on the numbers, done in the page — no lookup, no request. An internal addressing plan is exactly the thing not to type into a remote server, which is why this one does not have one.

Why does /24 give 254 usable and /31 give 2?

A /24 reserves its first address as the network and its last as the broadcast. A /31 has only two addresses and no room for either, so RFC 3021 defines both as usable — it is the standard prefix for a router-to-router link.

What are the other spellings of an address for?

Because most network stacks resolve 127.1, 2130706433 and 0x7f.1 to the same place as 127.0.0.1. It is shown so you can see why a filter that checks whether a string starts with "127." is not a loopback check — that mistake is a live SSRF vector.

Does a supernet merge my blocks?

It contains them, which is not the same thing. Everything between them is inside it too, so announcing or permitting the supernet announces or permits the gaps as well — the "addresses it adds" figure is exactly that.

Feed it from

Next

These accept what this tool produces, so the result can go straight in.