Network

IPv4 / CIDR calculator

Type an address with optional /prefix. Network math updates live.

IPv4 napkin math, not a firewall

Use this when you need network, broadcast, mask, wildcard, and usable-host counts from an IPv4 CIDR and you do not want to do the shifts in your head during a change window. Type 192.168.1.0/24 or a host with a prefix. The strip updates as you type. IPv6 is not here. A missing slash is treated as /32 (one host), which is the usual “why is usable hosts 1?” surprise.

The unique failure is treating the output as permission. Computing 10.0.0.0/8 does not open a port, write an iptables rule, or update a cloud security group. It tells you what the bits mean. Whether a packet is allowed is a different box. Same class of mistake: using broadcast as a gateway, or putting the network address on a NIC and wondering why neighbors never answer.

Worked example: 192.168.1.0/24

Prefix 24. Mask 255.255.255.0. Network 192.168.1.0. Broadcast 192.168.1.255. Usable hosts 254. First usable 192.168.1.1, last 192.168.1.254. Wildcard 0.0.0.255 (the mask flipped, what some ACLs want). 256 addresses exist; two are reserved, so 2^(32−24)−2 = 254. If you assign .0 to a laptop, you assigned the network address. If you ping .255, you pinged broadcast. Home routers still put the gateway on .1 by habit, not by law.

Worked example: 10.0.0.0/16 and a host with no slash

Type 10.0.0.0/16. Mask 255.255.0.0. Network 10.0.0.0, broadcast 10.0.255.255, usable 65,534. That is a lot of hosts for one L2 domain; the math is still the math. Now delete the slash and type 10.0.0.1. Prefix becomes 32. Usable hosts 1. First and last are both 10.0.0.1. You did not just “forget a number.” You asked for a single host. If you meant the class-A mental model, you wanted 10.0.0.0/8 (16,777,214 usable), which is a different ticket.

Worked example: /31 and /32

RFC 3021 point-to-point links use /31: two addresses, no subtracted network/broadcast pair. Type 192.168.1.0/31. Usable hosts 2. First and last are the two addresses. /32 is a host route: one address, usable 1. This page special-cases prefix ≥ 31 so you do not get the nonsense “2^1 − 2 = 0 usable” that napkin math produces for /31. If a vendor still forbids /31 on that interface, the calculator will not know. Read the vendor notes. A /30 is the older point-to-point habit: 4 addresses, 2 usable. Type 192.168.1.0/30 and you should see first 192.168.1.1, last 192.168.1.2, broadcast .3. People who “just use /30 for everything” waste half the block compared with /31 on links that allow it.

What this will not do

IPv6, ASN lookups, live routing tables, “is this RFC1918,” or splitting one /24 into four /26s as a wizard. Wildcard masks are displayed; they are not pushed to a switch. Broadcast and network are labels on bits, not a promise that your DHCP pool is correct. If you need six subnets from a /22 (1,022 usable on the parent), do the splits on paper or in the tool you use to write the ACL, then type each result here to check. Overlapping 10.0.0.0/16 and 10.0.1.0/24 is legal math and a routing headache — this page will not warn you. The compute is local bit math. It will not save a change window you already started.

What is CIDR notation?

An IPv4 address plus a prefix length, e.g. 192.168.1.0/24. The prefix is how many leading bits are the network. /24 is 255.255.255.0.

Why is usable hosts 254 on a /24, not 256?

256 addresses exist. Network (.0) and broadcast (.255) are reserved, so 2^(32−24)−2 = 254. /31 and /32 skip that subtraction.

I typed 10.0.0.1 with no slash. Why /32?

No prefix means a single host. Add /8, /16, or /24 if you meant a network. 10.0.0.1/32 is one address; 10.0.0.0/8 is 16,777,214 usable hosts.

Does this change my firewall?

No. It is mental math. Computing 10.0.0.0/8 does not open a port, write an ACL, or talk to a router.

Is IPv6 supported?

No. This page is IPv4 only. Do not paste a 2001:db8::/32 and expect a result.

Is this a whois lookup?

No. Bit math on the string you typed. It will not tell you who announces 8.8.8.8.

Related tools