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.
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 Diagnostics, Generators & UtilitiesAll Tools
IPv4 Reverse DNS Name Generator
Generate address-level reverse lookup names.
Reverse DNS Zone Planner
Identify applicable reverse delegation boundaries.
Bounded IP Address List Generator
Enumerate a selected, limited address range.
Random Address Sampler
Sample addresses within supplied ranges.
Batch Subnet Calculator
Calculate details for multiple prefixes.
IP List Deduplicator
Remove repeated addresses.
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.
Paste the addresses
Enter IPv4 and IPv6 addresses in any order.
Convert to integers
IPv4 values become 32-bit integers and IPv6 values become 128-bit integers.
Sort numerically
IPv4 sorts before IPv6, and each family sorts in ascending numeric order.
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 IPv6Common convention.
Lexical error
"10.0.0.100" < "10.0.0.9" as textText 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.
| Position | Alphabetical Order (Wrong) | Numeric Order (Correct) | Integer Value |
|---|---|---|---|
| 1 | 10.0.0.100 | 2.2.2.2 | 33,686,018 |
| 2 | 10.0.0.9 | 9.255.255.255 | 167,772,159 |
| 3 | 10.10.0.1 | 10.0.0.9 | 167,772,169 |
| 4 | 100.64.0.1 | 10.0.0.100 | 167,772,260 |
| 5 | 172.16.0.1 | 10.10.0.1 | 168,427,521 |
| 6 | 192.168.1.10 | 100.64.0.1 | 1,681,915,905 |
| 7 | 192.168.1.2 | 172.16.0.1 | 2,886,729,729 |
| 8 | 192.168.10.1 | 192.168.1.2 | 3,232,235,778 |
| 9 | 2.2.2.2 | 192.168.1.10 | 3,232,235,786 |
| 10 | 9.255.255.255 | 192.168.10.1 | 3,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.