CIDR Calculator

Turn CIDR notation into an IP range, subnet mask, and host count — or an IP range or subnet mask back into CIDR. IPv4 and IPv6.

Enter a CIDR range above to calculate

Is an IP inside a CIDR block?

Yes — 10.0.42.7 is inside 10.0.0.0/16.

Do two CIDR blocks overlap?

Overlap — 10.0.128.0/20 sits inside 10.0.0.0/16 (10.0.128.0 – 10.0.143.255).

CIDR blocks never partly overlap: one is inside the other, or they don't touch at all. Overlapping VPCs can't be peered.

CIDR to subnet mask cheat sheet

CIDRSubnet maskAddressesUsable hosts
/8255.0.0.016,777,21616,777,214
/12255.240.0.01,048,5761,048,574
/16255.255.0.065,53665,534
/17255.255.128.032,76832,766
/18255.255.192.016,38416,382
/19255.255.224.08,1928,190
/20255.255.240.04,0964,094
/21255.255.248.02,0482,046
/22255.255.252.01,0241,022
/23255.255.254.0512510
/24255.255.255.0256254
/25255.255.255.128128126
/26255.255.255.1926462
/27255.255.255.2243230
/28255.255.255.2401614
/29255.255.255.24886
/30255.255.255.25242
/31255.255.255.25422
/32255.255.255.25511

Was the IP / CIDR Calculator helpful?

Get new tools in your inbox

About once a month, when new tools ship. No spam, one-click unsubscribe.

We store only your email to send these updates. Privacy

About this tool

The ToolNinja CIDR Calculator is a free online subnet calculator and IP range calculator. Enter any CIDR notation (e.g. 192.168.1.0/24) to instantly calculate the subnet mask, network address, broadcast address, first and last usable host, and total number of hosts — all displayed with a full binary breakdown. Whether you need to calculate CIDR from an IP address, convert IP to CIDR notation, find CIDR ranges for a network, or use it as a subnetting CIDR calculator — ToolNinja handles every scenario directly in your browser. The CIDR to IP range calculator shows the complete host range so you can immediately see which addresses fall within your subnet. Use it as an ip to cidr calculator when configuring cloud VPCs in AWS, GCP or Azure, as a subnet CIDR calculator for firewall rules, or as a subnetting calculator for network planning. The binary display makes it ideal for learning how CIDR notation and subnet masks work at the bit level. Everything runs 100% in your browser — no login, no server calls, no data ever leaves your machine. A Split into Subnets tool takes your calculated network and divides it into equal-sized smaller subnets in one step, showing the CIDR, broadcast address, and usable range for each — handy when you've settled on a parent block and need to carve it up across multiple availability zones or network segments. IPv6 CIDR ranges (e.g. 2001:db8::/32) are supported too — paste any IPv6 address with a /prefix and get the network address, last address in the range, and total address count, shown in both compressed (:: shorthand) and fully expanded form. It also works in reverse. Paste an IP range like 10.0.0.0 - 10.0.3.255 and it returns the smallest set of CIDR blocks that covers exactly that range. Paste an address with a dotted subnet mask (192.168.1.10 255.255.255.0) and it converts the mask to its /prefix. Paste a mask on its own (255.255.240.0) and it shows the prefix, wildcard mask, and network size.

When to use it

  • →Converting an IP range (start – end address) into CIDR blocks for an allowlist or firewall rule
  • →Turning a dotted subnet mask like 255.255.255.0 into CIDR prefix notation
  • →Calculating subnet ranges for AWS VPC, GCP VPC or Azure Virtual Network CIDR blocks
  • →Converting IP addresses to CIDR notation for firewall rules and security groups
  • →Subnetting large networks into smaller CIDR ranges for network segmentation
  • →Verifying CIDR to IP range calculations before deploying network infrastructure
  • →Learning how CIDR notation and subnet masks work with the binary display
  • →Calculating how many hosts fit in a given subnet for capacity planning
  • →Splitting a parent CIDR block into equal subnets for multi-AZ VPC layouts
  • →Finding the network and last address of an IPv6 allocation, or expanding a compressed IPv6 address to its full form

Tips

  • ◆A /24 gives 254 usable hosts (256 minus network and broadcast). A /25 splits that into two subnets of 126 usable hosts each.
  • ◆AWS VPCs reserve 5 addresses per subnet (network, broadcast, and 3 AWS-reserved). Factor this in when choosing your CIDR block.
  • ◆Use /32 to represent a single host route and /0 to represent the default route (all traffic).
  • ◆Use Split into Subnets when planning a multi-AZ VPC — dividing a /22 into four /24s gives one clean subnet per zone.
  • ◆For IPv6, just include a colon in the input (e.g. 2001:db8::/32) and the tool automatically switches to IPv6 mode — no separate toggle needed.
  • ◆IPv6 doesn't have a broadcast address the way IPv4 does — this tool shows the 'last address' in the range instead, since IPv6 uses multicast for broadcast-like behavior.

Frequently asked questions

How do I convert an IP range to CIDR?

Enter the range as start - end (for example 172.16.0.0 - 172.16.5.255). A single CIDR block has to start on a boundary that's a multiple of its size, so most ranges need more than one block. That example becomes 172.16.0.0/22 plus 172.16.4.0/23. The calculator finds the smallest set of aligned blocks that covers the range exactly.

What is 255.255.255.0 in CIDR notation?

255.255.255.0 is /24: three octets of 1-bits (8 + 8 + 8 = 24). Other common ones: 255.255.0.0 is /16, 255.255.255.128 is /25, 255.255.255.192 is /26, and 255.255.240.0 is /20. The prefix is simply the number of 1-bits in the mask. The cheat sheet below lists every prefix from /8 to /32.

What does CIDR stand for and what problem does it solve?

CIDR stands for Classless Inter-Domain Routing. Before CIDR, IP addresses were assigned in fixed classes (A, B, C) which wasted huge blocks of addresses. CIDR replaced this with variable-length subnet masking (VLSM) — the /prefix notation lets you specify exactly how many bits are the network portion, enabling fine-grained allocation and more efficient use of the IP address space.

How do I choose the right subnet size for my use case?

Calculate the number of hosts you need and choose the smallest prefix that accommodates them, plus growth room. Formula: usable hosts = 2^(32 - prefix) - 2. For 100 hosts you need /25 (126 usable). For 500 hosts you need /23 (510 usable). In cloud environments, choose larger than you think you need — subnets cannot be resized after creation without disruption.

What is the difference between the network address and the broadcast address?

The network address is the first IP in a subnet (all host bits are 0) — it identifies the subnet itself and cannot be assigned to a host. The broadcast address is the last IP (all host bits are 1) — packets sent to it are delivered to all hosts in the subnet. Both are reserved; usable host addresses are everything between them.

What are the private IP address ranges and when do I use them?

RFC 1918 defines three private ranges: 10.0.0.0/8 (16.7M addresses), 172.16.0.0/12 (1M addresses), and 192.168.0.0/16 (65K addresses). These are non-routable on the public internet — use them for internal networks, VPCs, and home LANs. Traffic to/from these ranges must go through NAT to reach the internet. 169.254.0.0/16 is link-local (APIPA), used when DHCP fails.

Why doesn't the IPv6 result show a broadcast address or usable host count like IPv4 does?

IPv6 doesn't use broadcast at all — it was deliberately removed from the protocol in favor of multicast, so there's no equivalent of IPv4's broadcast address to calculate. And because IPv6 subnets are almost always /64 or larger (18.4 quintillion addresses at /64 alone), 'usable hosts' isn't a meaningful planning number the way it is in IPv4 — allocation is normally done at the subnet-count level (how many /64s you need), not the host-count level.

CIDR to subnet mask cheat sheet

Every IPv4 prefix length from /8 to /32 with its subnet mask, wildcard mask, and address count.

CIDRSubnet maskWildcard maskAddressesUsable hosts
/8255.0.0.00.255.255.25516,777,21616,777,214
/9255.128.0.00.127.255.2558,388,6088,388,606
/10255.192.0.00.63.255.2554,194,3044,194,302
/11255.224.0.00.31.255.2552,097,1522,097,150
/12255.240.0.00.15.255.2551,048,5761,048,574
/13255.248.0.00.7.255.255524,288524,286
/14255.252.0.00.3.255.255262,144262,142
/15255.254.0.00.1.255.255131,072131,070
/16255.255.0.00.0.255.25565,53665,534
/17255.255.128.00.0.127.25532,76832,766
/18255.255.192.00.0.63.25516,38416,382
/19255.255.224.00.0.31.2558,1928,190
/20255.255.240.00.0.15.2554,0964,094
/21255.255.248.00.0.7.2552,0482,046
/22255.255.252.00.0.3.2551,0241,022
/23255.255.254.00.0.1.255512510
/24255.255.255.00.0.0.255256254
/25255.255.255.1280.0.0.127128126
/26255.255.255.1920.0.0.636462
/27255.255.255.2240.0.0.313230
/28255.255.255.2400.0.0.151614
/29255.255.255.2480.0.0.786
/30255.255.255.2520.0.0.342
/31255.255.255.2540.0.0.122
/32255.255.255.2550.0.0.011

Usable hosts excludes the network and broadcast addresses. /31 (point-to-point links, RFC 3021) and /32 (a single host) use every address.

Guides

Related tools

ToolNinja