Convert an IP address between CIDR, range and integer

Move IPv4 values between dotted notation, unsigned integers, CIDR ranges, and exact CIDR cover sets.

freeworks offlinenothing uploaded
ToolNetwork Address Converter
Input
Output

How it works

Four octets pack into one unsigned 32-bit value and unpack through bit shifts. Prefix masks find CIDR endpoints, while range conversion repeatedly takes the largest aligned power-of-two block that stays inside the requested interval.

  • The scope is IPv4, so values stop at 2³²−1 and prefix lengths at 32.
  • If start exceeds end, the endpoints are swapped before covering the interval.

Worked example

Cover one IPv4 /24 exactly
Input
											192.168.1.0 - 192.168.1.255
										
Output
												192.168.1.0/24
256 addresses
											

When to use this

Firewall inventories expand prefixes, databases store IPv4 as integers, and routing lists cover exact contiguous ranges.

Edge cases

  • IPv6 cannot fit this 32-bit representation.
  • An unaligned interval can require several prefixes even when its address count is a power of two.
  • An integer beginning with zero is interpreted as octal, which can surprise callers expecting decimal.

References