Skip to content

Number Sorter (Sort Numbers)

Free number sorter. Paste a list of numbers to sort them in order - natural numeric ordering means 2 comes before 10. Ascending or descending, copy in one click.

Runs in your browser

Paste a list of numbers, one per line, to sort them in ascending order. Natural numeric ordering is on, so 2 sorts before 10 (not after, like raw text would). Switch to Z-A for descending, and remove duplicates if you need a unique set.

7 lines in → 7 out (0 removed)

How to use it

  1. Paste your text

    One entry per line. A sample is preloaded so you can see the result straight away.

  2. Pick a sort order and options

    A-Z, Z-A, by length, reverse or random - plus case, natural numbers, trim, drop-empty and remove-duplicates.

  3. Copy the sorted list

    Output appears in the right pane with an in/out line count. Hit Copy to grab it all.

What is it?

A line sorter takes a text input and re-orders its lines by a chosen comparison: lexicographic (A-Z, Z-A), length, reverse, or random. The interesting choices are around stability (lines with equal keys keep their input order), locale (so 'café' sorts properly), and natural ordering (so 'page-2' beats 'page-10'). Optional trim and remove-duplicate passes clean the list before it's sorted.

When to use it

Putting a list of names, emails, slugs or URLs into alphabetical order before sharing or importing. Building an A-Z reference page from a notes dump. Shuffling a playlist or class roster when you need a random order. Reversing a list. Sorting a column of numbers. Putting a CSV's header line aside, then sorting the body, then pasting them back together.

Common mistakes

Sorting a CSV with a header row included - the header lands somewhere alphabetical and the file no longer parses. Forgetting that 'page-10' beats 'page-2' in pure-ASCII sort but not in natural sort. And using ascending order to mean 'oldest first' when the lines are dates in YYYY-MM-DD - that's already alphabetical-by-date, so ascending is oldest, descending is newest.

FAQ

Is the sort stable?
Yes. Lines that compare equal keep their relative input order. Important when you're sorting by length and want the original sequence preserved within each length bucket.
Does it handle numbers naturally?
Yes. 'item-2' sorts before 'item-10' using JavaScript's Intl-aware comparison; pure numeric lists (1, 2, 10, 20) also sort correctly. If you want raw ASCII order ('item-10' first), turn off natural ordering.
What about case?
Case-insensitive by default. Toggle case-sensitive to put all uppercase before lowercase ('A' before 'a').
Can it remove duplicates while sorting?
Yes - tick 'Remove duplicates' and each line is kept only once (respecting the case-sensitive setting). Combine it with A-Z for a clean, sorted, unique list in one pass.
What does 'Reverse' do versus 'Z-A'?
Reverse simply flips the current line order without sorting - last line first. Z-A sorts alphabetically in descending order. Use reverse to undo a sort or invert any list as-is.
Is my list uploaded anywhere?
No. All sorting runs locally in your browser - nothing is sent to a server, so it's safe for private or sensitive lists.

Sort Lines

Sort any list A-Z, Z-A, by length, reverse or shuffle - dedupe and trim as you go.

Try it out

More in this category