Text Sorter
Input 0
Output
Sorted result will appear here...

Text Sorter

Sort lines alphabetically, numerically, by length, or shuffle randomly

Runs locally · Nothing uploaded

Overview

An online text sorter that orders lines alphabetically, numerically, by length or randomly. It is useful for tidying a column copied from Excel, sorting IDs, grouping keywords alphabetically or shuffling a prize draw list. You can ignore empty lines and deduplicate before sorting, and the result updates in real time. Copy it or download it as a txt file — everything runs locally in your browser.

Features

  • Sort A→Z, Z→A, numerically ascending/descending, by length or shuffle randomly
  • Optionally ignore empty lines and deduplicate before sorting
  • Works line by line — ideal for names, IDs, logs and keywords
  • Live output with no generate button
  • Copy the result or download it as a .txt file
  • Runs entirely in your browser — no data is uploaded

How It Works

  1. 1 Paste the text into the input, one item per line
  2. 2 Pick A→Z, Z→A, numeric ascending, numeric descending, by length or shuffle
  3. 3 Enable ignore empty lines, and dedupe first if you need unique lines
  4. 4 The result panel updates live while the original input stays untouched
  5. 5 Copy or download the result and paste it back into Excel, a table or code

Tips

  • Enable ignore empty lines so blank rows do not jump to the top
  • Make sure each line starts with a number for reliable numeric sorting
  • Combine sorting with dedupe to produce a clean, ordered list quickly

Related tools

Tags TextSort

FAQ

How does numeric sorting detect numbers?

It reads the leading number on each line (whatever parseFloat can parse), so “10 items” and “2 items” sort as 2 then 10. Lines without a leading number are treated as 0, so pure number lists give the most predictable result.

Can it sort mixed Chinese and English text?

Yes. Alphabetical sorting uses the browser localeCompare, so Chinese follows local language rules and mixed content gets a stable order.

Does sorting remove duplicate lines?

Not by default. Duplicates are only merged when you enable dedupe; shuffling never removes any line.

Can a random shuffle be reproduced?

No. Each shuffle produces a new order, which is useful for draws and sampling. Use a fixed sort mode when you need a reproducible order.

How many lines can it handle?

Tens of thousands of lines are usually smooth, depending on your device. For very large text, split it into chunks to keep browser memory usage reasonable.