IP/CIDR Calculator — Subnet Mask & Network Range Online

IP/CIDR Calculator

CIDR Input

CIDR
24
24

Calculation Results

Please enter an IP address and CIDR.

About the IP/CIDR Calculator

Overview

Working out a subnet mask or the usable host range from a /24 or /20 by hand is tedious and easy to get wrong, especially once you're juggling multiple VLANs or VPC subnets at once. This calculator takes any IPv4 or IPv6 address with a CIDR prefix and instantly returns the netmask, network and broadcast addresses, usable host range and count, and the binary breakdown — so you can double-check a subnet design, plan an AWS or GCP VPC layout, or decode someone else's CIDR block without reaching for a notepad.

How to Use

  1. 1Pick the protocol, IPv4 or IPv6.
  2. 2Type an address into IP Address — you can include a /prefix here too (e.g., 192.168.1.100/24) and it'll populate the CIDR field for you.
  3. 3Otherwise, drag the CIDR slider to set the prefix length (e.g., 24) and watch the host range update live.
  4. 4Click Generate.

Specifications & Glossary

  • CIDR (Classless Inter-Domain Routing): The slash notation pairing an IP address with its prefix length, e.g. 192.168.1.0/24. It replaced the old classful A/B/C addressing scheme, which wasted huge blocks of address space, and lets you carve out a subnet of nearly any size instead of being locked into fixed class boundaries.
  • Subnet mask: The bitmask marking where the network portion ends and the host portion begins. A /24 prefix and a 255.255.255.0 mask describe the exact same boundary — CIDR notation and dotted-decimal masks are just two ways of writing the same value.
  • Network address: The first address in the subnet, with every host bit set to 0. Routers and configuration files use this to refer to the subnet as a whole, for example in a routing table entry.
  • Broadcast address: The last address in the subnet, with every host bit set to 1. IPv6 has no concept of broadcast — it relies on multicast instead, so this field only applies to IPv4.
  • Usable host count: For IPv4 this is 2^(host bits) - 2, reserving one address for the network identifier and one for broadcast. IPv6 subnets don't reserve a broadcast address, so the usable count there is simply 2^(host bits).
  • IPv4 vs IPv6: IPv4 addresses are 32 bits, written as four dot-separated decimal octets (192.168.1.1). IPv6 addresses are 128 bits, written as eight colon-separated groups of hex digits (2001:db8::1), and the vastly larger address space removes most of the scarcity pressure that drives aggressive subnetting under IPv4.
  • Binary representation: The address spelled out as a string of bits, so the boundary between the network portion and the host portion is something you can see, not just calculate.
  • Private IPv4 ranges: RFC 1918 reserves 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16 for use inside private networks. Office LANs and internal VPC subnets are typically carved out of these blocks rather than a publicly routable range.
  • IPv6 prefix length: An IPv6 address is 128 bits wide, and the common convention splits it in half — the upper 64 bits as the subnet prefix, the lower 64 bits as the interface identifier (the host portion).

Use Cases

  • Planning subnets for a VPC or an on-premises network before you commit to an address plan.
  • Double-checking that a firewall or security-group rule's IP range covers (or doesn't accidentally cover) the addresses you expect.
  • Sizing CIDR blocks when laying out a VPC on AWS, GCP, or Azure.
  • Estimating how a range splits into smaller subnets when breaking up an existing network.

FAQ

What does the "/24" in a CIDR block actually mean?
The number after the slash is the prefix length — how many leading bits of the address are fixed as the network portion. A /24 fixes the first 24 bits, leaving 8 bits (in IPv4) free to identify hosts within that block, which is what determines how many addresses the subnet can hold.
How does a CIDR prefix map to a subnet mask?
A CIDR prefix length and a dotted-decimal subnet mask describe the same thing two different ways: the prefix length is just the count of leading 1-bits in the mask. /24 converts to 255.255.255.0, and /16 converts to 255.255.0.0.
Does this tool support IPv6 addresses too?
Yes — switch the protocol selector to IPv6 and the calculator works with 128-bit addresses instead of 32-bit ones, returning the matching network address and prefix breakdown. One difference from IPv4 worth knowing: IPv6 has no broadcast address, since that role is handled by multicast instead.
How does this relate to private IP address ranges?
Compare the calculated network address against the RFC 1918 private ranges (10.0.0.0/8 and the others) to see whether the address you entered falls inside one. That's a quick way to catch overlapping ranges before wiring up a VPC or an office LAN.
How is the number of usable hosts calculated?
For IPv4 it's 2 raised to the number of host bits, minus 2. The minus 2 removes the all-zeros network address and the all-ones broadcast address, neither of which can be assigned to a host. A /24 has 8 host bits, so 2^8 - 2 gives you 254 usable addresses.
Is the IP address I enter sent anywhere externally?
No. Every calculation runs in JavaScript inside your browser, and the IP address or CIDR block you type never leaves your machine. That makes it safe to use even when you're working with internal network layouts you'd rather not send anywhere.