CIDR / Subnet Calculator

Enter an IPv4 or IPv6 address with a CIDR prefix to work out the network and broadcast address, the subnet mask and wildcard, the usable host range, the host count and the address type. Every value is computed with bit-math in your browser — nothing is uploaded.

Prefix:

CIDR notation
192.168.1.0/24
Subnet mask
255.255.255.0
Wildcard mask
0.0.0.255
Network address
192.168.1.0
Broadcast address
192.168.1.255
Usable host range
192.168.1.1 – 192.168.1.254
Usable hosts
254
Total addresses
256
IP class
C
Type
Private (RFC 1918)
Address (binary)
11000000.10101000.00000001.00001010
Netmask (binary)
11111111.11111111.11111111.00000000
Try:

How CIDR and subnetting work

Every IPv4 address is 32 bits split into two parts: a network part shared by every device on the same subnet, and a host part unique to each device. CIDR notation writes where that split falls as a slash and a prefix length — /24 means the first 24 bits are the network and the last 8 identify hosts. Flip the split and the subnet grows or shrinks in powers of two: each bit you give back to the host part doubles the number of addresses.

From the address and the prefix, three key addresses fall out by bit-math. The network address is the address with every host bit set to 0; the broadcast address is the address with every host bit set to 1; and everything strictly between them is the pool of usable host addresses. This calculator computes them by ANDing the address with the mask (network), ORing in the wildcard (broadcast), and adding or subtracting one for the first and last host — the same operations a router performs.

Worked example: 192.168.1.10 /26

A /26 uses 26 network bits and 6 host bits, so the mask is 255.255.255.192 and each block holds 26 = 64 addresses. The blocks step in multiples of 64, so 192.168.1.10 falls in the block that starts at 192.168.1.0: the network is 192.168.1.0, the broadcast is 192.168.1.63, and the 62 usable hosts run from 192.168.1.1 to 192.168.1.62. Enter 192.168.1.10/26 above to see it computed live.

CIDR prefix reference (/0 to /32)

Mask, wildcard and address counts are computed for every IPv4 prefix — not looked up, so always correct:

CIDRSubnet maskWildcardAddressesUsable hosts
/0 0.0.0.0 255.255.255.255 4,294,967,296 4,294,967,294
/1 128.0.0.0 127.255.255.255 2,147,483,648 2,147,483,646
/2 192.0.0.0 63.255.255.255 1,073,741,824 1,073,741,822
/3 224.0.0.0 31.255.255.255 536,870,912 536,870,910
/4 240.0.0.0 15.255.255.255 268,435,456 268,435,454
/5 248.0.0.0 7.255.255.255 134,217,728 134,217,726
/6 252.0.0.0 3.255.255.255 67,108,864 67,108,862
/7 254.0.0.0 1.255.255.255 33,554,432 33,554,430
/8 255.0.0.0 0.255.255.255 16,777,216 16,777,214
/9 255.128.0.0 0.127.255.255 8,388,608 8,388,606
/10 255.192.0.0 0.63.255.255 4,194,304 4,194,302
/11 255.224.0.0 0.31.255.255 2,097,152 2,097,150
/12 255.240.0.0 0.15.255.255 1,048,576 1,048,574
/13 255.248.0.0 0.7.255.255 524,288 524,286
/14 255.252.0.0 0.3.255.255 262,144 262,142
/15 255.254.0.0 0.1.255.255 131,072 131,070
/16 255.255.0.0 0.0.255.255 65,536 65,534
/17 255.255.128.0 0.0.127.255 32,768 32,766
/18 255.255.192.0 0.0.63.255 16,384 16,382
/19 255.255.224.0 0.0.31.255 8,192 8,190
/20 255.255.240.0 0.0.15.255 4,096 4,094
/21 255.255.248.0 0.0.7.255 2,048 2,046
/22 255.255.252.0 0.0.3.255 1,024 1,022
/23 255.255.254.0 0.0.1.255 512 510
/24 255.255.255.0 0.0.0.255 256 254
/25 255.255.255.128 0.0.0.127 128 126
/26 255.255.255.192 0.0.0.63 64 62
/27 255.255.255.224 0.0.0.31 32 30
/28 255.255.255.240 0.0.0.15 16 14
/29 255.255.255.248 0.0.0.7 8 6
/30 255.255.255.252 0.0.0.3 4 2
/31 255.255.255.254 0.0.0.1 2 2
/32 255.255.255.255 0.0.0.0 1 1

Private & reserved IPv4 ranges

Addresses in these blocks are handled specially — the calculator labels the type of whatever you enter:

RangeAddressesUse
10.0.0.0/816,777,216Large private networks (RFC 1918) — the whole 10.x block.
172.16.0.0/121,048,576Medium private networks (RFC 1918) — 172.16.0.0–172.31.255.255.
192.168.0.0/1665,536Home & small-office LANs (RFC 1918) — the familiar 192.168.x.x.
100.64.0.0/104,194,304Carrier-grade NAT (RFC 6598) — shared address space for ISPs.
169.254.0.0/1665,536Link-local / APIPA — self-assigned when no DHCP server answers.
127.0.0.0/816,777,216Loopback — 127.0.0.1 is your own machine (localhost).

IPv4 address classes

Before CIDR, the first octet fixed the network size into classes. They no longer control routing, but the labels are still widely used and this tool reports them: Class A (1–126) had an 8-bit network, Class B (128–191) a 16-bit network, and Class C (192–223) a 24-bit network. Class D (224–239) is multicast and Class E (240–255) is reserved. CIDR made this classful scheme obsolete by letting the prefix be any length, so an address can now be subnetted far more finely than its class once allowed.

A note on IPv6

IPv6 addresses are 128 bits, written as eight groups of four hex digits with :: compressing one run of zero groups (so 2001:0db8:0000:0000:0000:0000:0000:0001 becomes 2001:db8::1). The prefix works exactly as in IPv4, but the numbers are enormous: a single /64 — the standard size for one LAN — contains 264 ≈ 18 quintillion addresses, which is why IPv6 has no broadcast address and no host-count subtraction. Enter an IPv6 address above to see its network prefix, full address range and type.

Privacy

This calculator is pure client-side arithmetic — the addresses you enter never leave your device, nothing is logged and there are no network requests. It keeps working offline once loaded.

Frequently asked questions

What is CIDR notation?
CIDR (Classless Inter-Domain Routing) writes a network as an address followed by a slash and a prefix length — for example 192.168.1.0/24. The prefix is the number of leading bits that identify the network; the remaining bits identify hosts within it. A /24 has 24 network bits and 8 host bits, giving 256 addresses (2^8), of which 254 are usable for hosts. CIDR replaced the old fixed Class A/B/C boundaries so networks can be sized to fit, in any power-of-two step from a single address (/32) up to the whole internet (/0).
How do I calculate the number of usable hosts in a subnet?
Take 2 to the power of the number of host bits (32 minus the prefix for IPv4), then subtract 2 — one address is reserved as the network address and one as the broadcast address. So a /24 has 2^8 = 256 total and 254 usable; a /26 has 2^6 = 64 total and 62 usable; a /30 has 2^2 = 4 total and 2 usable. The two special cases are /31 (a point-to-point link per RFC 3021, where both addresses are usable, giving 2) and /32 (a single host, 1 address).
What is the difference between the network, broadcast and host addresses?
The network address is the first address in the block (all host bits 0) and names the subnet itself — you do not assign it to a device. The broadcast address is the last address (all host bits 1) and reaches every host on the subnet at once. Everything in between is the usable host range you assign to devices. This tool shows all three: for 192.168.1.0/24 the network is 192.168.1.0, the broadcast is 192.168.1.255, and the usable hosts are 192.168.1.1 through 192.168.1.254.
What is a subnet mask and how does it relate to the prefix?
A subnet mask is the same network/host split written as a dotted-decimal number, where the network bits are 1 and the host bits are 0. A /24 prefix is the mask 255.255.255.0; a /26 is 255.255.255.192; a /30 is 255.255.255.252. The wildcard mask is its bitwise inverse (0.0.0.255 for a /24), used in some ACLs and routing configs. The prefix, the mask and the wildcard are three ways of saying exactly the same thing — this calculator converts between them.
Which address ranges are private (not routable on the internet)?
RFC 1918 reserves three private IPv4 blocks: 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. Addresses in these ranges are used freely inside home and business networks and are not routed on the public internet — a router performs NAT to share one public address. There are also special ranges: 127.0.0.0/8 (loopback), 169.254.0.0/16 (link-local/APIPA), and 100.64.0.0/10 (carrier-grade NAT). This tool labels the type of any address you enter.
Does it support IPv6?
Yes. Enter an IPv6 address such as 2001:db8::1 with a prefix (commonly /64 for a LAN) and the calculator shows the network prefix, the full first-to-last address range, the address type (global unicast, link-local, unique-local, multicast, loopback) and the total number of addresses — which for IPv6 is astronomically large (a single /64 holds 2^64 addresses). It accepts :: zero-compression and IPv4-mapped forms and returns the canonical shortened notation. IPv6 has no broadcast address, so no host-count subtraction is applied.
Is anything uploaded or stored?
No. The whole calculator is plain JavaScript doing bit-arithmetic in your browser. The addresses you type never leave your device, nothing is logged and there are no network requests — it keeps working offline once the page has loaded.

Related tools

और टूल्स देखें

सभी 68 टूल्स देखें →