katlab tools/cidr support on Ko-fi

CIDR / Subnet Calculator · IPv4 & IPv6

Type a block like 10.0.0.0/22, an address with a netmask, or an IPv6 prefix. Get the network, host range, masks and address type — then split it into smaller subnets.

Everything runs locally in your browser. Nothing is sent to a server.

Subnet splitter

How to read the results

A CIDR block such as 10.0.0.0/22 is an address plus a prefix length: the first 22 bits identify the network and the remaining 10 bits number the hosts, giving 210 = 1,024 addresses. The netmask (255.255.252.0) is those 22 one-bits written as four octets, and the wildcard mask (0.0.3.255) is its inverse, the form Cisco ACLs and OSPF expect.

In IPv4 the first address of a block is the network address and the last is the broadcast, so usable hosts are the total minus two: 1,022 for a /22, 254 for a /24. Two prefixes are exceptions. A /31 has two usable addresses and no broadcast, because RFC 3021 allows it on point-to-point links. A /32 is one address, used for loopbacks and host routes.

If you type a host address with a prefix, like 10.0.0.5/22, the calculator computes the block that host belongs to, shows the normalized network 10.0.0.0/22, and says so, instead of silently treating 10.0.0.5 as a network. The binary view highlights exactly which bits are network and which are host.

Private, CGNAT and other special ranges

Not every address is routable on the internet. The Scope row labels a block using the IANA special-purpose registries, and when a block straddles several ranges it says what it contains.

RangeMeaning
10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16Private (RFC 1918)
100.64.0.0/10Carrier-grade NAT shared space (RFC 6598)
127.0.0.0/8 · ::1Loopback
169.254.0.0/16 · fe80::/10Link-local
224.0.0.0/4 · ff00::/8Multicast
192.0.2.0/24, 198.51.100.0/24, 203.0.113.0/24 · 2001:db8::/32, 3fff::/20Documentation
fc00::/7Unique local addresses (ULA, RFC 4193)

The CGNAT range deserves a special mention: it looks public but is used inside ISP and mobile networks, so if your router's WAN address starts with 100.64 to 100.127 you are behind carrier NAT and inbound port forwarding will not work. Classful labels (A, B, C) are shown for reference only; routing has been classless since 1993.

IPv6 prefixes are different

IPv6 addresses are 128 bits, so this page does its math with arbitrary-precision integers rather than JavaScript numbers, which lose precision past 253. There is no broadcast in IPv6 and no "minus two": every address in a prefix can be assigned, although on a LAN the all-zero interface ID is the Subnet-Router anycast address. That is why IPv6 rows show a first and last address instead of a host range.

Conventions matter more than host counts. A LAN is almost always a /64, because SLAAC needs a 64-bit interface ID. Sites commonly receive a /48 (65,536 LANs) or a /56 (256 LANs), and the calculator shows how many /64 networks fit in any shorter prefix. Addresses are displayed in the RFC 5952 canonical form (lowercase, leading zeros dropped, the longest run of zero groups replaced by ::) and in full expanded form. IPv4-mapped addresses such as ::ffff:192.168.1.1, NAT64 and 6to4 addresses also show the IPv4 address embedded inside them, with a button to analyze it directly.

Splitting a block into subnets

The splitter divides the current block either into a number of equal subnets or into subnets of a chosen prefix length. Because each extra prefix bit halves the block, the count is always a power of two: asking for 3 subnets of a /22 gives 4 /24s, and the page tells you when it rounds up. Each row lists the subnet, its host range, broadcast and usable count (IPv4) or first and last address (IPv6); click a subnet to open it in the calculator.

A /8 split into /30s is over four million rows, and an IPv6 /48 into /64s is 65,536, so the table and the CSV stop at the first 4,096 subnets and state the true total. The CSV has a header row and plain comma-separated fields, ready for a spreadsheet, an IPAM import or a Terraform variable file.

Why is 10.0.0.01 rejected?

Leading zeros are ambiguous: inet_aton and some older tools read 010 as octal 8, others as decimal 10. Rather than guess and hand you the wrong network, the calculator refuses and asks for the plain form.

Can I paste a wildcard mask?

Only netmasks are accepted after an address, but if you paste a wildcard such as 0.0.3.255 the error message names it and gives you the matching netmask. Non-contiguous masks like 255.0.255.0 are rejected because they do not describe a CIDR block.

How many /64 subnets are in a /48?

65,536 — that is 2(64 − 48). A /56 holds 256 and a /60 holds 16.

Does it support zone IDs like fe80::1%eth0?

Yes. The zone ID only picks the local interface, so it is stripped (and mentioned) before the calculation. Square brackets from URLs, as in [2001:db8::1], are stripped too.

Is my IP address sent anywhere?

No. Parsing and subnet math run in this page. Nothing is uploaded or looked up, and it keeps working offline once loaded.