Skip to main content
IP Range CalculatorPRO
Diagnostics, Generators & UtilitiesInstant Client-Side Tool

IP Address Sorter

Sort addresses numerically.

IP Address Sorter: 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

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.

How IP Address Sorter Works?

The IP Address Sorter works by converting every address to its integer value and sorting by that number, which avoids the errors of alphabetical sorting.

  1. Paste the addresses

    Enter IPv4 and IPv6 addresses in any order.

  2. Convert to integers

    IPv4 values become 32-bit integers and IPv6 values become 128-bit integers.

  3. Sort numerically

    IPv4 sorts before IPv6, and each family sorts in ascending numeric order.

  4. Output the sorted list

    The sorter prints the list in ascending or descending order.

IP Address Sorter Formula

The IP Address Sorter formula is Order by int(address), where int(a.b.c.d) = a × 16,777,216 + b × 65,536 + c × 256 + d.

Sort key

k = int(address)

Numeric value.

Family order

IPv4 before IPv6

Common convention.

Lexical error

"10.0.0.100" < "10.0.0.9" as text

Text sorting compares character by character.

Worked example: 10.0.0.9 vs 10.0.0.100

Text order:    10.0.0.100, 10.0.0.9   (character "1" < "9")
Integer order: 10.0.0.9 (167,772,169), 10.0.0.100 (167,772,260)

IP Address Sorter Conversion Table

The IP Address Sorter conversion table compares alphabetical order with numeric order for 10 addresses.

PositionAlphabetical Order (Wrong)Numeric Order (Correct)Integer Value
110.0.0.1002.2.2.233,686,018
210.0.0.99.255.255.255167,772,159
310.10.0.110.0.0.9167,772,169
4100.64.0.110.0.0.100167,772,260
5172.16.0.110.10.0.1168,427,521
6192.168.1.10100.64.0.11,681,915,905
7192.168.1.2172.16.0.12,886,729,729
8192.168.10.1192.168.1.23,232,235,778
92.2.2.2192.168.1.103,232,235,786
109.255.255.255192.168.10.13,232,238,081

What is IP Address Sorter?

The IP Address Sorter is a tool that sorts IP addresses in true numeric order instead of alphabetical order.

Spreadsheets and the plain sort command treat addresses as text. Text sorting places 10.0.0.100 before 10.0.0.9 and 100.64.0.1 before 9.255.255.255. The sorter compares the integer value of each address, which gives the order the network sees.

Linux users can get the same IPv4 result with sort -t . -k1,1n -k2,2n -k3,3n -k4,4n or sort -V. The sorter handles IPv6 and mixed IPv4/IPv6 lists in the same pass.

What are the uses of IP Address Sorter?

There are 4 main uses of the IP Address Sorter, including inventory lists, allow-list reviews, and log analysis.

  • Ordering inventory lists

    Device lists sorted by address make gaps and clusters visible.

  • Reviewing allow-lists

    Sorted lists make adjacent entries easy to spot for merging.

  • Analyzing logs

    Sorted source addresses group traffic by network.

  • Preparing reports

    Address tables in reports read in natural numeric order.