What are line tools?
Line tools work on text where every line is an item: a list of emails, URLs, names, IDs, log lines, SKUs or the rows you copied from a spreadsheet column. With one input box and one operation selector you can sort lines alphabetically or numerically, remove duplicate lines, reverse the order, number the lines, filter lines with a regular expression, add a prefix or suffix to every line, remove empty lines, trim spaces and join a list into one line (or split one line back into a list).
These are the chores people usually do with a spreadsheet, a sort | uniq pipeline or a one-off script. Here they run in the browser, in one place, with the output ready to copy. Typical uses: deduplicate a mailing list, sort a list of imports, add quotes and commas around values to build a SQL IN (...) list or a JSON array, number steps in a document, keep only the log lines that contain error, or turn a comma-separated string into one item per line.
All processing is local: the text never leaves your device. Large inputs are handled with guards: the regex filter stops after 50,000 lines or a short time budget to keep the page responsive and warns you when it did, and patterns that could freeze the browser (nested repetitions like (a+)+) are refused with an explanation.
The Tabs and spaces operation converts tabs to spaces the way a terminal shows them (each tab moves to the next multiple of the tab width, so columns stay aligned) anywhere in the line or only in the indentation, and converts runs of spaces back into tabs, with a tab width from 1 to 16.
How to sort, deduplicate and clean lines
- Paste your list in the input box, one item per line. A sample is loaded at first.
- Pick the operation: sort, remove duplicates, reverse, number, filter (regex), prefix/suffix, remove empty lines, trim spaces, join lines or split into lines.
- Adjust the options of that operation. Sort has A-Z, Z-A, numeric, by length, natural order and random, with ignore-case. Remove duplicates can ignore case or edge spaces, keep the first or last occurrence, or show only the repeated lines. Number lets you set start, step, separator and leading zeros. Join and split take a separator, where
\nis a line break and\ta tab. - Read the output and the line count, and copy it.
- Press "use output as input" to chain operations, for example trim, then deduplicate, then sort.
- If a warning says some lines start or end with spaces, run trim first, because spaces change how lines sort and match.
Examples
Remove duplicates, keeping the first
Input banana, Apple, cherry, apple, banana. Remove duplicates (case sensitive):
banana
Apple
cherry
appleWith "ignore case" on, apple is also treated as a duplicate of Apple:
banana
Apple
cherryNatural sort
file10, file2, file1 sorted A-Z gives file1, file10, file2. With natural order the numbers are compared as numbers: file1, file2, file10. Numeric sort of 10, 9, 100, 1 gives 1, 9, 10, 100.
Number the lines
a, b, c numbered starting at 8 with leading zeros and the separator - become:
08 - a
09 - b
10 - cBuild a quoted list
Prefix " and suffix ", applied to apple, banana, cherry:
"apple",
"banana",
"cherry",Filter and join
Filtering error: a, ok: b, error: c with the pattern ^error keeps two lines; in remove mode it keeps only ok: b. Joining apple, banana, cherry with , gives apple, banana, cherry; splitting it by , brings the three lines back.
Common mistakes
- Duplicates that are not removed because of trailing spaces.
appleandappleare different lines. Run trim first or enable the option to ignore edge spaces. - Sorting numbers as text. In A-Z order
10comes before9. Choose numeric or natural sort. - Invalid regular expression. The tool shows the reason and asks you to fix the pattern or escape special characters with a backslash.
- A pattern with nested repetitions such as
(a+)+, refused to protect the page. Simplify it, for example toa+. - Forgetting the separator syntax. Write
\nfor a line break and\tfor a tab in the separator field. - Expecting the same alphabetical order in every language. Sorting follows the language of the page, so accents and capital letters follow its rules.
Frequently asked questions
How do I remove duplicate lines online?
Paste the list, choose remove duplicates and copy the output. Enable ignore case if Apple and apple are the same for you.
How do I sort lines alphabetically?
Choose sort and the A-Z order. Z-A reverses it, and random shuffles the list using the browser's secure random generator.
Can I keep only the repeated lines?
Yes: in remove duplicates, choose to show only repeated lines. Each repeated line appears once.
How do I turn a comma-separated string into a list?
Use split with , as the separator, then trim spaces if needed.
What next?
Compare two lists with the text compare, or count words with the word counter. For structured conversions use the list converter.
How to do it in code
Bash
awk '!seen[$0]++' list.txt # remove duplicates, keep first
sort -n numbers.txt # numeric sort
grep '^error' log.txt # filter by regexPython
lines = ["banana", "Apple", "cherry", "apple", "banana"]
unique = list(dict.fromkeys(lines))
print(unique) # ['banana', 'Apple', 'cherry', 'apple']JavaScript
const lines = ['banana', 'Apple', 'cherry', 'apple', 'banana'];
console.log([...new Set(lines)]); // [ 'banana', 'Apple', 'cherry', 'apple' ]
console.log(['file10', 'file2', 'file1'].sort((a, b) => a.localeCompare(b, 'en', { numeric: true }))); // file1, file2, file10