Text Line Transformer
Sort, dedupe, and clean lines of text instantly.
Sort, dedupe, and clean lines of text instantly. Enter your numbers and get an instant result.
Paste lines of text and apply one transformation: sort them ascending or descending, drop empty lines, remove duplicate lines, reverse the order, or add a prefix and a suffix to every line. The result appears in a copy-ready box.
It works on lines, not on sentences or words. Sorting a paragraph therefore sorts the lines the paragraph happens to have, and deduplication compares whole lines, so two lines that differ only in trailing spaces are both kept.
Every transformation runs in the tab on the text you pasted. There is no upload and no stored history.
What each action does to the line list
Sorting uses the browser's default string comparison, which orders by UTF-16 code unit: uppercase letters come before lowercase, and "10" comes before "9". It is a stable ordering for identical lines but not a numeric or a locale-aware one.
The prefix and suffix action writes the two strings in front of and behind every line, including lines that are empty, which is how you turn a list into quoted strings or into SQL values.
- Sort A to Z and Z to A are code-unit order, not alphabetical order for mixed case
- Remove empty lines drops lines that contain only whitespace
- Remove duplicate lines keeps the first occurrence of each exact line
When a line tool is the wrong tool
If the text is a CSV row, splitting on commas is part of the job and this page will not do it: a quoted comma stays inside the field, so the line still looks like one line. Use the CSV formatter for that.
If you need to change case, collapse runs of spaces or strip a character class, those are different transformations and are not offered here. Doing them by hand after a sort is usually the shortest route.
How to use the action and lines
Paste the lines into the Input Text box and pick the Transform Action: Sort Alphabetically A to Z or Z to A, Remove Empty Lines, Remove Duplicate Lines, Reverse Lines, or Add Prefix and Suffix with the two fields filled. The Result box updates from the same text and has its own copy control.
Sorting is code-unit order, so uppercase comes before lowercase and 10 before 9; deduplication keeps the first of each exact line including trailing spaces. The page works on lines, not CSV fields or sentences: quoted commas split, trailing newlines make an empty final line, and there is no case change offered.
What to Expect
Best for
- Sorting a list of names, hosts or tags
- Removing duplicate entries from a pasted column
- Wrapping every line with a prefix and a suffix
Not ideal for
- Case changes, trimming or whitespace collapse
- Numeric or locale-aware sorting
- CSV or any text where a delimiter inside quotes matters
What this tool keeps
- The order of the lines you did not ask to sort
- The first occurrence of each duplicate
- The exact characters of every line apart from the transformation you chose
What may need cleanup
- Mixed-case lists, where code-unit order is not what a reader calls alphabetical
- Trailing spaces, which make two visually identical lines distinct
- A trailing newline at the end of the pasted text, which produces one empty final line
Common errors
- Expecting a numeric sort from a list of numbers
- Expecting case-insensitive deduplication
- Sorting a paragraph and expecting sentence order to survive
Example use cases
- Turning a pasted column into a quoted list for a script
- Deduplicating a list of domains or tags
- Reversing the order of a changelog's lines
Sample input
Paste banana, apple, an empty line, cherry and banana, then sort A to Z.
Sample output
The empty line, apple, banana, banana and cherry, in code-unit order.
Who this is for
- Developers preparing a list for a script
- Anyone tidying a pasted column
- Editors deduplicating a list of links
Frequently asked questions
What transformations can I apply to a list of lines?
Sort ascending or descending, drop empty lines, remove duplicates, reverse the order, or add a prefix and suffix to every line, one transformation per run.
Does it trim whitespace or change case?
No. It moves and edits whole lines only, so trimming and case changes need a different tool.
Why did my list sort in an order I did not expect?
Sorting compares character codes rather than locale rules, so mixed-case or accented lines may not come out in the order a reader calls alphabetical.
Build custom tools for your store
Join the SDK program to create useful ecommerce utilities for your store.