Skip to main content
UtilityStack

IPv4 CIDR Calculator — subnet breakdown

Type an IPv4 address with CIDR prefix (192.168.1.42/24) and see the network address, broadcast, subnet mask, wildcard, host range, count of usable hosts, and whether the address is private (RFC 1918), loopback, or public.

Network
192.168.1.0/24
Broadcast
192.168.1.255
Subnet mask
255.255.255.0
Wildcard
0.0.0.255
First host
192.168.1.1
Last host
192.168.1.254
Total addresses
256
Usable hosts
254
Private (RFC 1918)

What is CIDR notation?

CIDR (Classless Inter-Domain Routing) replaces the older Class A/B/C system with a flexible prefix length. '192.168.1.0/24' means 'the first 24 bits identify the network, the remaining 8 bits identify hosts within it' — that's a network with 256 addresses, of which 254 are usable for hosts (the network and broadcast addresses are reserved).

This tool parses any IPv4 address with optional CIDR prefix, computes all the derived values (mask, broadcast, host range), and flags whether the address falls into the private RFC 1918 ranges (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) or the loopback range (127.0.0.0/8). Useful for designing networks, sizing DHCP pools, writing firewall rules, and reading routing tables.

How to use this tool

  1. Type an IPv4 address followed by /prefix — e.g. '10.20.30.40/16' or '192.168.1.0/24'. If you omit the prefix, /32 is assumed (single host).
  2. The breakdown updates instantly: network, broadcast, mask, host range, total addresses. The badge shows whether the address is private, loopback, or public.
  3. Use the values directly in your network configuration: the mask in your dhcpd.conf, the network/broadcast in firewall rules, the host range when allocating fixed IPs.

Frequently asked questions

What's the difference between /24 and 255.255.255.0?

They mean the same thing in different notation. '/24' (CIDR) says 'the first 24 bits are the network'. '255.255.255.0' (subnet mask) is the same 24 bits expressed as four octets. Modern config (Linux, Cisco IOS XE, Junos) prefers CIDR; older config sometimes only accepts dotted-decimal mask.

Why are 2 addresses unusable in a typical subnet?

The first address (host bits all zero) is the network address — used in routing tables, can't be assigned to a host. The last address (host bits all one) is the broadcast — packets to it go to every host in the subnet. /31 and /32 are exceptions: /31 (RFC 3021) lets both addresses be hosts for point-to-point links; /32 is a single host route.

What's the wildcard mask?

The bitwise inverse of the subnet mask, used in some Cisco ACL rules. Mask 255.255.255.0 has wildcard 0.0.0.255. The 1-bits in the wildcard are 'don't care'. Used less frequently today (most modern config accepts CIDR directly).

How many hosts can /20 fit?

2^(32-20) = 4096 addresses, of which 4094 are usable. Common sizes: /28 = 14 hosts, /27 = 30, /26 = 62, /25 = 126, /24 = 254, /23 = 510, /22 = 1022, /21 = 2046, /20 = 4094. Memorise these for sizing networks on the fly.

Does this tool support IPv6?

No — IPv4 only. IPv6 CIDR is similar conceptually but the address space is enormous (128-bit) and the typical prefix lengths are different. For IPv6 calculations, dedicated tools handle the math. The same RFC 1918-style 'private' concept doesn't quite apply — IPv6 has unique-local addresses (fc00::/7) instead.

Common use cases

Where the calculator earns its keep.

Designing a home or office network

How many devices fit in a /24? (254). What's the broadcast? How many subnets do I need? The calculator answers these instantly so you can size the network without back-of-envelope math.

Writing firewall and NAT rules

iptables and nftables rules need explicit network/mask. Paste the CIDR, copy the network and mask, drop them into the rule. Avoids the off-by-one errors of doing the math by hand.

Reading log entries

When a log shows '10.42.5.180 connecting to 172.31.255.42', a quick check tells you both are RFC 1918 (private). Public addresses warrant different scrutiny.

Cloud VPC sizing

AWS VPC, Azure VNet, GCP VPC all use CIDR. Need a network that fits ~500 hosts? /23 (510 usable) is the right sizing. The calculator confirms before you commit.

Tips and shortcuts

Habits that prevent IP mistakes.

Memorise common prefix sizes

/30 = 2 hosts, /29 = 6, /28 = 14, /27 = 30, /26 = 62, /25 = 126, /24 = 254. These cover almost every real-world subnet you'll size. Going bigger? /23 = 510, /22 = 1022, /16 = 65,534.

Don't allocate /24 when /28 fits

Five servers don't need 254 addresses. Use /28 (14 usable) and reserve the rest for future expansion. Tight subnetting makes routing tables smaller and security policies more precise.

Document the purpose of each subnet

10.0.10.0/24 means little. '10.0.10.0/24 — engineering laptops' means a lot. Subnet allocation drift is a long-tail of operational confusion; documentation pays for itself in the first incident.

Reserve enough for growth

If you have 50 hosts now, a /26 (62 usable) covers it but you'll outgrow it within a year. /24 (254 usable) is overkill. /25 (126 usable) is the right call — comfortable now, doesn't waste address space.

Herramientas relacionadas