Sort text lines
Sort your lines as text or numbers.
- 1Add input
- 2Adjust settings
- 3Get your result
Tool input and files are processed in this browser without being uploaded.
Before you start
Sort pasted lines as text or exact decimal values, in ascending or descending order. Equal values keep their original order; blank lines go last.
How to use this tool
- Paste one item per line into “Text”, or load the numeric example.
- Choose Unicode lexical order or exact decimal values, then choose ascending or descending.
- Sort, inspect the line order, then copy or download the complete result.
Supported inputs and limits
Paste up to 1 MiB. Numeric mode requires every nonblank line to be one valid decimal number, with no labels or separators.
Numeric exponents must be between −1,000,000 and 1,000,000. Text order compares UTF-16 units without locale collation. Malformed Unicode is rejected.
Worked example
Example input
9007199254740993 2 -1 1.01
Example options
{
"mode": "numeric"
}Example output
-1 1.01 2 9007199254740993
When something does not work
Keep the source text. If numeric sorting rejects a line, remove labels or separators or switch to text mode. Shorten input above 1 MiB and run again.
Frequently asked questions
Are my files uploaded?
No. Files and tool input are processed in your browser. Moving around the site can keep a temporary workspace in the same tab. Refreshing or closing the tab clears it, so download results you want to keep.
What should I check in this result?
Text mode compares Unicode string units, so “10” comes before “2”. Numeric mode compares decimal digits and exponents without rounding large integers, so 2 comes before 10. Equal values keep their input order and blank lines go last in either direction.
Documentation & further reading
Related tools
Convert text encoding
Choose the right text encoding and save a readable TXT file.
Merge text files
Put several text files together in the order you choose.
Word counter
Words, characters, and paragraphs at a glance.
Case converter
Change letter case to suit your text.