Text Line Tools
Paste a list and clean it up in one click: sort, deduplicate, reverse, shuffle, number, trim, remove blank lines or wrap every line with a prefix and suffix. Nothing is uploaded.
Eight tools in one
Sort, deduplicate, reverse, shuffle, number, trim, remove blank lines and add prefixes or suffixes without switching pages.
Smart sorting
Sort alphabetically, naturally (file2 before file10), by line length or by the number at the start of each line, ascending or descending.
Chain operations
Send the output back to the input to combine steps, for example trim, remove duplicates, then sort.
>> technical info
How Line Tools Work:
The text is split on line breaks (LF, CRLF or CR), each operation is applied to the list of lines and the result is joined back with line feeds. Sorting is stable, so equal lines keep their original order. Duplicate detection compares whole lines, optionally ignoring case or surrounding spaces, and keeps the first occurrence. Shuffling uses the Fisher-Yates algorithm.
Example:
Sort lines A-Z banana, apple, cherry -> apple, banana, cherry
Why Use These Line Tools:
- >Clean lists, logs, keyword sets and exports in seconds
- >Natural sort handles file names and version numbers correctly
- >Stable, predictable results with clear line counts
- >Private: your text never leaves the browser
>> frequently asked questions
Q: How do I remove duplicate lines?
A: Choose "Remove duplicate lines". The first occurrence of each line is kept and later copies are dropped. Enable "Ignore case" or "Ignore surrounding spaces" to treat near-identical lines as equal.
Q: What is natural sort?
A: Natural sort compares digit sequences as numbers, so file2 comes before file10. Plain alphabetical sort would put file10 first.
Q: How does numeric sort treat lines without a number?
A: Lines that do not start with a number are placed after the numbered lines in their original order.
Q: Is the order preserved for equal lines?
A: Yes. Sorting is stable, so lines that compare equal stay in their original order.
Q: Is my text uploaded?
A: No. Everything runs locally in your browser.
Other Languages
References
How we make sure
We check this tool with the automated test suites linked below. Example checks are shown in their original language.
- Verification method
- Check line splitting, sorting, duplicates, case options and set union/intersection/difference.
- Comparison reference
- Explicit input and expected output lists.
- Verification scope
- These samples and boundaries do not prove correctness for every input.
Test source and cases (select a file to read it)
-
text-line-tools.test.js
- splitLines handles LF, CRLF, CR and a trailing newline
- sortLines alphabetical is code point order unless ignoring case
These checks cover the listed examples and boundaries, not every possible input. Round trips and checks using the same library are not independent verification.