Text & String Utilities100% Client-Side

Sort IPv4 Addresses in Numeric Order

Paste IPv4 addresses to arrange them by numeric value. The tool reads the first dotted IPv4-shaped value on each line and moves the complete line along with it. That puts an address ending in .2 before one ending in .100 when the other octets match. Use valid dotted-decimal addresses, one per line, to compare entries in a list or a fixture.

Configuration Options
Input
34 chars•3 lines
Output

How to Use the Sort IPv4 Addresses Numerically Online

  1. 1Paste valid IPv4 addresses, keeping the address and any label on the same line.
  2. 2Choose ascending for low address values first or descending for high values first.
  3. 3Check lines that contain more than one dotted value because the first match controls the sort.
  4. 4Copy the ordered rows after confirming that unrelated lines are out of the list.

Input & Output Examples

Ascending order compares .2 and .100 numerically after matching the first three octets.

Input Sample
192.0.2.100
192.0.2.2
198.51.100.1
Expected Output
192.0.2.2
192.0.2.100
198.51.100.1

Descending order moves the whole labeled line. The first octet has priority, then the last octet breaks the remaining tie.

Input Sample
backup 192.0.2.9
primary 198.51.100.4
spare 192.0.2.20
Expected Output
primary 198.51.100.4
spare 192.0.2.20
backup 192.0.2.9

Practical Developer Workflows

  • Arrange example addresses in a documentation table while keeping their labels attached.
  • Compare a numeric address order with how the same strings would sort alphabetically.
  • Produce a small fixed-order fixture from a list of IPv4 examples.

Zero Server Uploads & Complete Privacy

Runs 100% in your browser; no data is uploaded to any server.

Notice a bug, calculation error, or outdated info?

Let us know directly so our engineering team can fix it.

Frequently Asked Questions

The tool looks for four dot-separated groups, so provide IPv4 addresses in dotted-decimal form. IPv6 uses a different structure. An IPv6-only line with no embedded dotted match is handled like any other line without a match.

Explore Other Tools

12 suggested tools

View all tools