Kalkulator podsieci
Obliczenia CIDR, zakresy hostów, rozbicia binarne i dzielenie podsieci — wszystko w przeglądarce
Paste a CIDR block into the first box and the mask fills itself in, or type an address on the left and a dotted mask (or just 24) on the right. Everything recalculates as you type.
The vertical bar marks the prefix boundary: bits to its left are thenetwork portion (fixed for every host in the subnet), bits to its right are the host portion.
About Subnetting and CIDR
An IPv4 address is 32 bits long, usually written as four decimal octets such as192.168.1.130. On its own an address says nothing about which network it belongs to — that comes from the subnet mask, which splits those 32 bits into a network portion and a host portion. Every device that shares the same network portion is on the same subnet and can talk directly, without a router.
What CIDR notation actually means
CIDR (Classless Inter-Domain Routing, RFC 4632) writes the mask as a single number after a slash: the count of leading 1 bits. So /24 means "the first 24 bits are the network", which is exactly the same statement as the dotted mask 255.255.255.0. CIDR replaced the old fixed class A/B/C boundaries in 1993 because they wasted enormous amounts of address space — an organisation needing 300 addresses had to be handed a whole class B of 65,536.
mask 11111111.11111111.11111111.11000000 = 255.255.255.192
address 11000000.10101000.00000001.10000010 = 192.168.1.130
network 11000000.10101000.00000001.10000000 = 192.168.1.128
broadcast 11000000.10101000.00000001.10111111 = 192.168.1.191
How the mask works, bit by bit
The mask is a run of 1 bits followed by a run of 0 bits — never mixed, which is why255.255.0.255 is not a legal mask. To find the network address the router performs a bitwise AND of the address with the mask, which forces every host bit to 0. To find the broadcast address it ORs the network with the wildcard mask(the mask inverted), which forces every host bit to 1. The wildcard is not just a curiosity: Cisco ACLs and OSPF network statements are written with wildcards rather than masks.
Each bit you move the boundary to the right halves the subnet and doubles the number of subnets. A /24 holds 256 addresses; a /25 holds 128; a/26 holds 64. In general a /n holds 2(32−n)addresses, of which the first is the network identifier and the last is the directed broadcast, leaving 2(32−n) − 2 usable host addresses.
Why /31 exists — and why /32 is not broken
That "minus 2" rule collapses at the small end, and it is where most subnet calculators get the answer wrong.
- /30 — 4 addresses, 2 usable. This was the traditional way to number a point-to-point link between two routers, wasting half the block on a network identifier and a broadcast address that nothing on a two-node link needs.
- /31 — 2 addresses, and 2 usable hosts. RFC 3021 (2000) says that on a point-to-point link there is no need to reserve a network or broadcast address, because a packet sent to "everyone else on this link" can only reach the one peer anyway. Both addresses are assignable, halving the address consumption of router-to-router links. Naively computing 2 − 2 would report zero usable hosts, which is wrong.
- /32 — 1 address, 1 usable host, and no broadcast address at all. A /32 is a single host route: a loopback interface, a virtual IP, an anycast service address, or a firewall rule that matches exactly one machine.
This calculator applies those three rules explicitly rather than blindly subtracting two, so the /31 and /32 results are the ones your router will actually accept.
RFC 1918 private ranges
Three blocks are reserved for private internets by RFC 1918. They are never routed across the public internet, so anyone may use them internally and NAT out through a public address:
10.0.0.0/8— 10.0.0.0 to 10.255.255.255, 16,777,216 addresses (one old class A).172.16.0.0/12— 172.16.0.0 to 172.31.255.255, 1,048,576 addresses (16 contiguous class Bs). Note it stops at 172.31, not 172.255.192.168.0.0/16— 192.168.0.0 to 192.168.255.255, 65,536 addresses (256 class Cs). The default for nearly every home router.
Several other blocks are special but not private in the RFC 1918 sense, and this tool flags them too:
127.0.0.0/8— loopback;127.0.0.1is only the most famous member.169.254.0.0/16— link-local (APIPA), self-assigned when DHCP fails.100.64.0.0/10— carrier-grade NAT (RFC 6598), used inside ISP networks.192.0.2.0/24,198.51.100.0/24,203.0.113.0/24— documentation ranges (RFC 5737), safe to use in examples.224.0.0.0/4— multicast (old class D);240.0.0.0/4— reserved (old class E).
Address classes
The class shown in the results is the historical classful reading of the first octet: A (0–127), B (128–191), C (192–223), D multicast (224–239) and E reserved (240–255). Modern routing ignores it entirely — the prefix length is what matters — but it still turns up in exam questions, older documentation and vendor CLI defaults.
Privacy
Every calculation on this page runs locally in your browser using plain JavaScript. Nothing you type is sent to a server, and no network request is made.