Text Line Tools

Tidy up messy multi-line text: sort, dedupe, remove empty lines, trim spaces. One click, clean result.

Original text (one item per line)
Operations
Result
—
Click “Tidy” and the result appears here, ready to copy.

The operations people actually need

OperationWhat it is for
Remove duplicatesCleaning a list of URLs, emails or IDs before import
SortAlphabetical, reverse, or numeric ordering
Remove empty linesTidying output pasted from a PDF or a spreadsheet
Trim whitespaceRemoving invisible leading and trailing spaces that break matching
Add prefix / suffixTurning a bare list into quoted strings, SQL values or CSV rows
Number linesReferencing specific rows in a review

Sorting is not as simple as it looks

Plain string sorting compares character codes, which puts 10 before 9 and handles case inconsistently — in a strict comparison an uppercase Z sorts before a lowercase a. A numeric sort parses values first, so 2 precedes 10. A case-insensitive sort ignores capitalisation entirely. Pick the mode that matches your data, and expect different tools to default differently.

Line endings

Unix systems end lines with \n; Windows traditionally uses \r\n; classic Macs used a bare \r. Mixed line endings are a frequent cause of "everything on one line" imports and of diffs where every line appears changed even though the text is identical. When a file misbehaves after being moved between systems, check the line endings before anything else.

Duplicates and near-duplicates

Related tools

Text diff Word & character counter Text case converter

FAQ

Does dedupe preserve the original order?
Yes. Deduplication keeps the first occurrence of each line and only removes later duplicates, so the order stays intact.
Is sorting case-sensitive?
Yes. Uppercase letters sort before lowercase (by Unicode code point). Pinyin ordering for Chinese is not guaranteed — use a dedicated tool if you need precise Chinese collation.
Is my text uploaded?
No. All processing happens locally in your browser; the text is never sent to a server.