BYTETOOLS

IP Address Sorter

Sort IPv4 and IPv6 address lists in true numeric order — not alphabetical — with de-duplication and invalid-line reporting. Free and 100% in-browser.

5
Addresses sorted
1
Duplicates removed
0
Invalid lines

Sorted addresses

What is the IP Address Sorter?

The IP Address Sorter puts a pasted list of IP addresses into true numeric order. Plain text sorting gets this famously wrong — alphabetically, 192.

  • True numeric ordering — no more 1, 10, 100, 2 alphabetical mess
  • Handles IPv4 and IPv6 together, IPv4 first
  • De-duplication that recognizes equivalent IPv6 spellings
  • Ascending or descending order
  • Invalid lines reported separately, never silently lost
  • Instant, fully client-side sorting — works offline

How to use the IP Address Sorter

  1. 1

    Paste your IP addresses, one per line — IPv4 and IPv6 can be mixed.

  2. 2

    Choose ascending or descending order and whether to remove duplicates.

  3. 3

    Review the sorted output, plus counts of duplicates removed and invalid lines.

  4. 4

    Click Copy sorted to take the cleaned list away.

About the IP Address Sorter

The IP Address Sorter puts a pasted list of IP addresses into true numeric order. Plain text sorting gets this famously wrong — alphabetically, 192.168.1.100 comes before 192.168.1.9 because "1" < "9" character-wise. This tool compares IPv4 addresses as 32-bit integers and IPv6 addresses as 128-bit hextet tuples, so 10.0.0.9 correctly precedes 10.0.0.100.

Mixed lists are fine: IPv4 addresses sort first, then IPv6, each family in proper numeric order, ascending or descending. Duplicates can be removed as you sort — including IPv6 duplicates written differently, since 2001:db8::1 and its expanded form normalize to the same key — and invalid lines are set aside and reported rather than silently dropped.

It is built for cleaning log extracts, firewall exports and inventory dumps. Sorting happens instantly and locally in your browser; no address list is ever uploaded.

Frequently asked questions

Why do IP addresses sort wrongly in Excel or a text editor?

Because they are compared character by character as text: "192.168.1.100" beats "192.168.1.9" since the fourth-octet comparison sees '1' before '9'. Correct ordering requires converting each address to its numeric value first, which is exactly what this sorter does.

How are IPv6 addresses sorted?

Each address is expanded to its eight 16-bit hextets and compared hextet by hextet from the left — equivalent to comparing the full 128-bit values. Compressed and expanded spellings of the same address sort (and de-duplicate) identically.

Can I sort a mixed list of IPv4 and IPv6 addresses?

Yes. The list is grouped by family — all IPv4 addresses first, then all IPv6 — with true numeric ordering inside each group. Descending order reverses the entire arrangement.

What happens to lines that are not valid IP addresses?

They are excluded from the sorted output and listed separately under "skipped invalid lines", so you can see exactly what was left out and fix it. Nothing is silently discarded.

Does de-duplication treat 2001:db8::1 and 2001:0db8:0000:0000:0000:0000:0000:0001 as the same?

Yes. Every address is normalized to its canonical numeric form before duplicate detection, so different textual spellings of the same address count as one — the first spelling you pasted is the one kept.

Related tools