Network

CIDR / Subnet Calculator

Enter an IPv4 or IPv6 address with a CIDR prefix to get the network, mask, broadcast, usable host range and address count, split a block into smaller subnets, summarize a list of CIDRs into the fewest exact blocks, or compare two ranges.

Guide: CIDR Notation and Subnet Masks: A Practical Cheat Sheet

Ready.
Address192.168.1.10
Network192.168.1.0/24
Netmask255.255.255.0
Wildcard mask0.0.0.255
Broadcast192.168.1.255
Total addresses256
Usable host range192.168.1.1 - 192.168.1.254
Usable hosts254
Binary11000000.10101000.00000001.00001010
Hexadecimal0xC0A8010A
Address class (historic)C
Private (RFC 1918)Yes

Summarize CIDRs

Paste addresses or CIDR blocks, one per line (IPv4 and IPv6 can be mixed), and get back the exact minimal set of blocks that covers them — never more addresses than you listed.

Compare two ranges

Check whether two CIDR blocks are equal, one contains the other, they partially overlap, or they are disjoint.

What it does

Enter an address with a CIDR prefix, such as 192.168.1.10/24 or 2001:db8::/32, and the tool works out the network address, broadcast (IPv4), usable host range and how many addresses the block contains.

IPv4 details

For a /31 there is no broadcast (point-to-point, RFC 3021: both addresses are usable); a /32 is a single host. The netmask, wildcard mask (used in Cisco ACLs) and whether the address is private (RFC 1918) or loopback are also shown.

Splitting a network

Choose a longer prefix and select "List subnets" to see every smaller subnet the current network splits into, each with its own first and last address. The list is capped at 1024 rows.

IPv6

IPv6 addresses are shown in both compressed and fully expanded form, along with the first and last address of the block and a rough guess at its scope (link-local, unique local or global).

Example

172.16.5.4/12 is not a /12 network address: the tool masks the host bits and reports the network 172.16.0.0/12, broadcast 172.31.255.255 and 1,048,574 usable hosts. Splitting 192.168.0.0/24 into /26 lists four subnets of 62 usable hosts each.

Summarize and compare

The Summarize CIDRs box takes one address or block per line, IPv4 and IPv6 mixed, and returns the smallest list of blocks that covers exactly those addresses: 10.0.0.0/24, 10.0.1.0/24 and 10.0.2.0/24 become 10.0.0.0/23 plus 10.0.2.0/24, because three /24s cannot form one block. Lines that cannot be parsed are listed separately. Compare two ranges reports whether two blocks are equal, nested, partly overlapping or disjoint, which is useful before adding a firewall rule or a route.

Limits

  • Input must be an address with an optional prefix length such as /24. A dotted netmask like 10.0.0.1/255.255.255.0 is not accepted; convert it to a prefix first (255.255.255.0 is /24).
  • Splitting is IPv4 only, needs a longer prefix than the current one, and stops at 1024 subnets.
  • The address class and the IPv6 scope are only hints. Use the prefix, not the class, to reason about a network.

To read the binary behind a mask or an octet, use the Number Base Converter. When a block ends up inside a URL, the URL Parser separates the host from the port and path.

Examples

  • 192.168.1.10/24 gives the network 192.168.1.0/24, netmask 255.255.255.0, wildcard mask 0.0.0.255, broadcast 192.168.1.255, 256 addresses in total, the usable host range 192.168.1.1 - 192.168.1.254 (254 hosts), the historic class C and “Private (RFC 1918): Yes”.
  • 10.0.0.0/31 has 2 addresses and both are usable. A /31 is the point-to-point case of RFC 3021, so there is no separate network and broadcast address.
  • 2001:db8::/32 is IPv6. The tool shows the expanded form 2001:0db8:0000:…, the first and the last address and the size as 2^96 addresses, which is too large to list exactly.

Splitting, summarizing and comparing

  • Split: 192.168.1.0/24 split into /26 blocks gives four subnets with 62 usable hosts each: 192.168.1.0/26, 192.168.1.64/26, 192.168.1.128/26 and 192.168.1.192/26. For example, the third one has the hosts 192.168.1.129 - 192.168.1.190.
  • Summarize: the three lines 10.0.0.0/24, 10.0.1.0/24 and 10.0.2.0/23 become one exact block, 10.0.0.0/22. The result covers exactly the addresses you listed and nothing more, so it is safe for a firewall rule.
  • Compare: 10.0.0.0/16 and 10.0.5.0/24 give “A contains B: every address in B is inside A.” The tool also reports equal, partially overlapping and disjoint ranges.

Frequently asked questions

How do I work out the number of usable hosts?

A prefix of /n leaves 32 minus n host bits. The block has 2 to the power of that many addresses, and for blocks up to /30 two of them are reserved for the network and the broadcast address. A /24 therefore has 254 usable hosts and a /26 has 62.

What is a wildcard mask?

The inverse of the netmask. It is written in access lists on some network devices, where 0 means “this bit must match” and 1 means “any value”.

Which IPv4 ranges are private?

The RFC 1918 blocks 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. The tool tells you when an address is inside one of them, or is a loopback address.

Is the address I enter sent anywhere?

No. All calculations run in your browser.

Privacy

This tool runs entirely in your browser. What you enter is processed on your device and is not sent to a server.

Share this tool

Your data is not included in this link.