IPv4 Range Calculator
Find address boundaries from a prefix.
IPv4 Range Calculator: inputs and results
Enter an IP address, CIDR prefix, or range. Then check its first and last address below.
Calculated Boundaries & ParametersReady
Key Capabilities
- •100% Client-Side: Zero telemetry or server latency.
- •RFC Compliant: Exact 32-bit and 128-bit integer precision.
- •Quick Copy: Instant access to CIDR, mask, and range bounds.
- •Cross-Platform: Works on desktop, tablet, and mobile browsers.
Related IPv4 Subnetting & RangeAll Tools
IPv4 Subnet Calculator
Calculate subnet details from address and mask.
Network Address Calculator
Find the subnet’s network address.
IPv4 Broadcast Address Calculator
Find broadcast addresses where applicable.
First and Last Address Calculator
Identify a range’s endpoints.
Usable IPv4 Host Range Calculator
Apply the selected subnet-use rules.
Total Address Count Calculator
Count addresses within a prefix.
How IPv4 Range Calculator Works?
This tool works in 4 steps: it reads an address, applies the prefix mask, sets every host bit to 0 for the range start, and sets every host bit to 1 for the range end. All 4 steps run as 32-bit integer math inside the browser.
Read the address and prefix
The calculator accepts an IPv4 address such as
10.20.37.140and a prefix length from /0 to /32. Pasting10.20.37.140/22fills both values at once.Convert the address to 32 bits
Each of the 4 octets (8 bits each) is joined into one unsigned 32-bit integer.
10.20.37.140becomes 169,092,492.Clear the host bits
A bitwise AND with the subnet mask keeps the network bits and zeroes the rest. The result is the first address of the range.
Fill the host bits
A bitwise OR with the wildcard mask sets every host bit to 1. The result is the last address, and the distance between both ends gives the address count.
IPv4 Range Calculator Formula
The formula is Range Start = IP AND Mask, and Range End = Range Start OR (NOT Mask). The address count equals 2 raised to the number of host bits.
Range start
Start = IP AND MaskKeeps the leftmost p bits and sets the remaining 32 − p bits to 0.
Range end
End = Start OR (2^(32−p) − 1)The value 2^(32−p) − 1 is the wildcard mask written as an integer.
Address count
Count = 2^(32 − p)A /22 holds 2^10 = 1,024 addresses, or 4 contiguous /24 blocks.
Block size in the active octet
Block = 256 − mask octetA /22 mask has 252 in the 3rd octet, so ranges step by 4 in that octet.
Worked example: 10.20.37.140/22
Mask = 255.255.252.0 (3rd octet 11111100) 3rd octet = 37 = 00100101 37 AND 252 = 00100100 = 36 Start = 10.20.36.0 End = 10.20.36.0 OR 0.0.3.255 = 10.20.39.255 Count = 2^(32−22) = 1,024 addresses
IPv4 Range Calculator Conversion Table
The table shows the range start, range end, and address count for 10.20.37.140 at 12 prefix lengths, from /16 down to /30.
| Prefix | Range Start | Range End | Addresses |
|---|---|---|---|
| /16 | 10.20.0.0 | 10.20.255.255 | 65,536 |
| /18 | 10.20.0.0 | 10.20.63.255 | 16,384 |
| /20 | 10.20.32.0 | 10.20.47.255 | 4,096 |
| /21 | 10.20.32.0 | 10.20.39.255 | 2,048 |
| /22 | 10.20.36.0 | 10.20.39.255 | 1,024 |
| /23 | 10.20.36.0 | 10.20.37.255 | 512 |
| /24 | 10.20.37.0 | 10.20.37.255 | 256 |
| /25 | 10.20.37.128 | 10.20.37.255 | 128 |
| /26 | 10.20.37.128 | 10.20.37.191 | 64 |
| /27 | 10.20.37.128 | 10.20.37.159 | 32 |
| /28 | 10.20.37.128 | 10.20.37.143 | 16 |
| /30 | 10.20.37.140 | 10.20.37.143 | 4 |
What is IPv4 Range Calculator?
The IPv4 Range Calculator is a tool that turns an IPv4 address and prefix length into the exact first and last address of the block that contains it. A prefix such as /22 defines a block of 1,024 addresses, and the calculator returns where that block starts and ends.
IPv4 addresses are 32-bit numbers, written as 4 decimal octets between 0 and 255. Classless Inter-Domain Routing (CIDR), defined in RFC 4632, splits those 32 bits into a network part and a host part. The IPv4 Range Calculator applies that split and reports the boundaries as plain start–end values that firewall, DHCP, and IP address management (IPAM) systems accept.
The calculator focuses on range boundaries, not on host usability rules. A /30 block returns 4 addresses from start to end, and the network and broadcast reservations appear on the Usable IPv4 Host Range Calculator page.
What are the uses of IPv4 Range Calculator?
There are 6 main uses of the IPv4 Range Calculator, including firewall rule writing, log filtering, and allocation audits.
Writing firewall rules
Firewalls that accept only start–end ranges need the exact boundaries of a CIDR block.
10.20.36.0/22becomes10.20.36.0–10.20.39.255.Filtering logs and SIEM queries
Security Information and Event Management (SIEM) searches often compare integer addresses. The range start and end give the lower and upper filter limits.
Auditing IP allocations
Network teams compare the computed range with IPAM records to confirm that an assigned block matches its documented size.
Reading geolocation and ASN data
Many IP databases store blocks as start–end pairs. The calculator converts a prefix into the same format for direct lookups.
Checking address ownership
Regional Internet Registry (RIR) records list allocations by prefix. The range shows every address that belongs to the allocation.
Preparing cloud allow-lists
SaaS dashboards and API gateways often accept ranges, not prefixes. The calculator produces both ends for copy-and-paste entry.