Pikkola Network Studio, tool No. 37

An address block, read down to the bit.

Type a CIDR or an address with a mask and get the network, the broadcast, the host range and the exact count, for IPv4 and IPv6. See which bits belong to the network, what kind of range this is, and the firewall line to paste. Nothing leaves the tab.

0 – 128
prefix bits
0
requests sent
IPv4
and IPv6

The calculator

One block, every number in it

Prefix, mask and wildcard are three spellings of the same rule. Type any of them and the rest follow, with a mistake named instead of guessed at.

The bits
24 network 8 host

Network bits sit on the left and never change inside the block. Host bits are free to number a machine.

Network address
192.168.10.0
Subnet mask
255.255.255.0
Broadcast
192.168.10.255
Wildcard
0.0.0.255
First host
192.168.10.1
Last host
192.168.10.254
Network / host
24 / 8
Addresses
256
2^8
Usable hosts
254
first and last held back

The line to paste

allow 192.168.10.0/24;
deny all;

Each line is written from the block above. Check the direction of a firewall rule before you ship it.

The splitter

Cut a block into smaller ones

Choose the prefix you want and every subnet appears with its own range. Each result is a real block: no address is shared and none is left out.

New prefix/24

Split into

Subnets 64 subnets
# CIDR Network Last Usable

The overlap check

Two blocks, one question

Whether one range contains the other, whether they merely cross, or whether they never meet. The answer is the arithmetic, not a guess from the numbers.

⊂

A contains B

Reading a block

Three things the prefix decides

The number after the slash is the count of fixed bits at the front. Everything a calculator tells you follows from that one count.

01

The two ends go to the network

In IPv4 the lowest address names the subnet and the highest is the broadcast, so neither goes to a machine. A /24 therefore holds 254 hosts, not 256. The exceptions are /31, a two-address point-to-point link (RFC 3021), and /32, a single host.

02

A mask, a wildcard, a prefix

255.255.255.0, 0.0.0.255 and /24 are the same decision written three ways: the mask keeps the left bits, the wildcard is its complement, and the prefix counts them. An access list usually wants the wildcard, a config file the mask.

03

IPv6 has no broadcast

Every address in an IPv6 block can belong to an interface, so a /64 holds 2^64 addresses rather than two fewer. The all-zero host part is the subnet-router anycast address, and /127 gives a point-to-point pair.

IPv4 prefixes you will meet
Prefix Mask Addresses Usable
/8255.0.0.016,777,21616,777,214
/16255.255.0.065,53665,534
/20255.255.240.04,0964,094
/24255.255.255.0256254
/25255.255.255.128128126
/26255.255.255.1926462
/27255.255.255.2243230
/28255.255.255.2401614
/29255.255.255.24886
/30255.255.255.25242
/31255.255.255.25422
/32255.255.255.25511
IPv6 blocks you will meet
Prefix 2^n Addresses Usable
/322^9679,228,162,514,264,337,593,543,950,336the same
/482^801,208,925,819,614,629,174,706,176the same
/562^724,722,366,482,869,645,213,696the same
/642^6418,446,744,073,709,551,616the same
/1272^122
/1282^011

In IPv6 the first column is the block, the second the usual size. The host count is 2 to the power of the bits that are left.

Counts are computed, not copied from a table.

Questions

Why can't I use the first and last address?

In IPv4 the first address of a block is the network address and the last is the broadcast, and both are reserved for those jobs. A host that answers on either is usually a misconfiguration. /31 and /32 are the exceptions and this page treats them the same way.

What is a wildcard mask?

The reverse of a subnet mask. Where the mask has a 1 the address must match, where it has a 0 anything goes. 255.255.255.0 becomes 0.0.0.255. Cisco access lists and some firewalls want the wildcard, which is why this page shows both.

Can I use a /31 for a link between two routers?

Yes. RFC 3021 allows a /31 on a point-to-point link: the two addresses are the two ends, and no network or broadcast is reserved. Some older equipment still insists on a /30, which wastes two addresses per link.

What does CGNAT mean for my addresses?

Carrier-grade NAT uses 100.64.0.0/10, a block that is not private in the RFC 1918 sense but is not routable on the public internet either. If your server sees a 100.64.x.x address, the connection came through a carrier's NAT, not from a customer's own network.

Why is an IPv6 /64 such a big number?

Because the host part is 64 bits, which is 18,446,744,073,709,551,616 addresses. A /64 is the standard size for one LAN because stateless autoconfiguration expects 64 host bits. Dividing it further is possible and usually unnecessary.

Does anything get uploaded?

No. Every number is computed in this tab, the content policy forbids network requests, and there is no server that could receive an address. Only the language, the theme and the last block you typed are kept in this browser.