IP Range Calculator
Enter a start and end IPv4 address to calculate the total number of IPs in the range, classify the range as private or public, and find the matching CIDR block.
Calculate IP Address Range
Range Details
- Total Addresses—
- First IP—
- Last IP—
- Scope—
- CIDR Block—
How IP Ranges Work
Every IPv4 address is a 32-bit integer. The human-readable dotted-decimal format (e.g. 192.168.1.1) is just a representation. To count addresses in a range, convert both IPs to integers and subtract:
Count = End_IP_integer − Start_IP_integer + 1
IP to integer: octet1×16777216 + octet2×65536 + octet3×256 + octet4
Private vs. Public IP Ranges
- 10.0.0.0 – 10.255.255.255 — Private Class A (RFC 1918)
- 172.16.0.0 – 172.31.255.255 — Private Class B (RFC 1918)
- 192.168.0.0 – 192.168.255.255 — Private Class C (RFC 1918)
- 169.254.0.0 – 169.254.255.255 — Link-local (APIPA, RFC 3927)
- All other ranges are public and globally routable via the internet.
CIDR Alignment
A range aligns to a single CIDR block when two conditions are met: the count is a power of 2, and the start IP falls on the correct network boundary (all host bits are 0). If your range doesn't align, it can be expressed as a list of CIDR blocks using the technique of splitting at power-of-2 boundaries.
192.168.1.0 – 192.168.1.255 → 256 addresses → aligns to 192.168.1.0/24
10.0.0.0 – 10.0.0.127 → 128 addresses → aligns to 10.0.0.0/25
192.168.1.1 – 192.168.1.10 → 10 addresses → spans multiple CIDR blocks
Frequently Asked Questions
How do I calculate the number of IPs in a range?
Convert both addresses to 32-bit integers. Subtract start from end and add 1. Example: 192.168.1.0 = 3232235776, 192.168.1.255 = 3232236031. Count = 3232236031 − 3232235776 + 1 = 256.
What is the difference between a private and public IP range?
Private ranges (RFC 1918) are used on internal networks behind a router/NAT and cannot be routed on the internet. Public IPs are globally unique and assigned by IANA/ISPs. If you see 192.168.x.x or 10.x.x.x, you're on a private network.
When does an IP range align to a single CIDR block?
When the address count is exactly a power of 2 (256, 512, 1024, etc.) and the start IP's host bits are all 0. A range like 192.168.1.0–192.168.1.255 aligns perfectly to /24. A range like 192.168.1.50–192.168.1.150 does not align to any single CIDR block.