Skip to main content
IP Range CalculatorPRO
IPv4 Subnetting & RangeInstant Client-Side Tool

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.

Quick presets:

Calculated Boundaries & ParametersReady

Network Address192.168.1.0
Broadcast Address192.168.1.255
First Usable Host192.168.1.1
Last Usable Host192.168.1.254
Subnet Mask255.255.255.0
Wildcard Mask0.0.0.255
Total Addresses256
Usable Host Range254

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.

  1. Read the address and prefix

    The calculator accepts an IPv4 address such as 10.20.37.140 and a prefix length from /0 to /32. Pasting 10.20.37.140/22 fills both values at once.

  2. 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.140 becomes 169,092,492.

  3. 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.

  4. 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 Mask

Keeps 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 octet

A /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.

PrefixRange StartRange EndAddresses
/1610.20.0.010.20.255.25565,536
/1810.20.0.010.20.63.25516,384
/2010.20.32.010.20.47.2554,096
/2110.20.32.010.20.39.2552,048
/2210.20.36.010.20.39.2551,024
/2310.20.36.010.20.37.255512
/2410.20.37.010.20.37.255256
/2510.20.37.12810.20.37.255128
/2610.20.37.12810.20.37.19164
/2710.20.37.12810.20.37.15932
/2810.20.37.12810.20.37.14316
/3010.20.37.14010.20.37.1434

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/22 becomes 10.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.