Line Utilities
Sort · Deduplicate · Transform
Sort
Filter
Transform
ChainUse + beside any operation to build a multi-step cleanup pipeline.
CustomFilter, wrap, split, or join lines with your own value.
Input10 lines · 9 non-blank · 6 unique
Output
🔖
Bookmark this page
Press Ctrl+D (Windows) or ⌘D (Mac) to save this tool in your browser for instant access anytime — no sign-up needed.

Line Utilities — Sort, Deduplicate & Transform Text Lines

Share

About this tool

Sort, Deduplicate, and Transform Text Lines Online

Line Utilities is a free online text tool for sorting, filtering, and transforming a list of lines. You paste your text, click one button, and get the result instantly. There are no settings to configure and nothing to install. The tool is designed for the tasks that developers, writers, and data workers do constantly: alphabetically sorting a word list, removing duplicates from a dataset, cleaning up blank lines in an export, numbering lines for a reference, or converting a list into a comma-separated value for a SQL query or JavaScript array.

Lists show up constantly in real work. You export a column from Excel or Google Sheets and get 500 lines. A log file has repeated entries you need to deduplicate. An API response gives you a JSON array and you need to pull out the values, one per line, then sort them. A client gives you a list of product names with inconsistent casing. A requirements document has bullet points you want to number. In every case, the actual operation is simple — the friction is the lack of a tool that does just that one thing without opening a full text editor or writing a terminal command.

The Sort group covers six operations: alphabetical ascending (A→Z), alphabetical descending (Z→A), by line length shortest first, by line length longest first, numerically ascending (for lines that are numbers), and random shuffle. Sorting numerically is useful when your lines are numbers like port numbers, IDs, or row counts — regular alphabetical sort would put 10 before 9 because it sorts character by character. Shuffle is useful for randomizing a list for sampling or randomized order tests.

The Filter group removes unwanted lines. "Remove duplicates" keeps the first occurrence of each unique line and discards subsequent identical lines. "Remove duplicates (case-insensitive)" does the same but treats "Apple" and "apple" as the same. "Remove blank lines" strips out any empty lines or lines that contain only whitespace. These three operations cover the most common data-cleaning tasks when working with exports, log files, or pasted content.

The Transform group modifies every line without changing the order. "Trim whitespace" removes leading and trailing spaces and tabs from each line — useful when pasting from a document that added indentation. "Lowercase" and "Uppercase" convert every character. "Number lines" prefixes each line with its sequential number (1. line one, 2. line two, etc.) — useful for creating numbered reference lists. "Quote each line" wraps each line in double quotes — useful when building an array of strings. "Comma-separate" collapses all non-blank lines into a single comma-separated string on one line — the fastest way to build a SQL IN clause or a JavaScript array literal from a list.

Operations can be chained. Click Swap after any operation to move the output back to the input, then run another operation on the result. A common workflow: paste a messy export → sort A→Z → swap → remove duplicates → swap → remove blank lines → comma-separate. Each step takes one click.

The stats bar shows live counts: total lines, non-blank lines, and unique lines in the input, and the same three counts for the output after an operation. This helps you verify that deduplication removed the expected number of duplicates, or that your comma-separate collapsed the expected number of lines.

All processing happens in your browser. Your text is never sent to a server. The tool works with any language and any content — there is no character set restriction.

Features

  • Sort lines A→Z alphabetically ascending
  • Sort lines Z→A alphabetically descending
  • Sort by line length — shortest first or longest first
  • Sort numerically (for lines that are numbers)
  • Shuffle lines in random order
  • Reverse line order
  • Remove duplicate lines (exact match)
  • Remove duplicates case-insensitively
  • Remove blank and whitespace-only lines
  • Trim leading and trailing whitespace from each line
  • Convert all lines to lowercase
  • Convert all lines to uppercase
  • Number each line (1. line, 2. line, ...)
  • Wrap each line in double quotes
  • Comma-separate all lines into one string
  • Live input stats: total, non-blank, unique line counts
  • Swap output back to input for chaining operations
  • Copy output to clipboard in one click
  • Runs entirely in your browser — no data sent to a server

How to Use

  1. 1
    Paste your textType or paste your lines into the Input textarea. The stats bar shows total lines, non-blank lines, and unique line count.
  2. 2
    Pick an operationClick any button in the Sort, Filter, or Transform groups. The result appears instantly in the Output box.
  3. 3
    Chain operationsClick ⇅ Swap to move the output back to input, then run another operation on the result.
  4. 4
    Copy the outputClick Copy to copy the result to your clipboard. The output stats bar shows the result's line and character count.

Common Use Cases

Sort a list alphabetically
Paste any word list, name list, or tag list and click Sort A→Z. Get a clean alphabetical result in one click.
Remove duplicate lines
Deduplicate an export, log file, or copy-pasted list. Case-sensitive and case-insensitive modes both available.
Build a SQL IN clause
Paste a list of values and click Comma-separate to produce "value1, value2, value3" — ready to paste into a SQL WHERE IN statement.
Clean up pasted data
Remove blank lines, trim whitespace, fix casing — apply multiple transforms by chaining operations with the Swap button.
Number a reference list
Add sequential numbers to every line instantly. Useful for turning a bullet list into a numbered list without manually typing numbers.
Shuffle a list randomly
Randomize the order of lines for sampling, randomized tests, or just shuffling a playlist.

Frequently Asked Questions

Paste your text into the Input box, then click "Sort A → Z" for ascending order or "Sort Z → A" for descending. The sorted lines appear in the Output box instantly. Click Copy to copy the result.

Paste your text and click "Remove duplicates" to keep only the first occurrence of each unique line. For case-insensitive deduplication (treating "Apple" and "apple" as the same), use "Remove duplicates (case-insensitive)".

Yes. After the first operation, click ⇅ (Swap) to move the output back to the input, then apply the next operation. For example: sort → swap → deduplicate → swap → number lines.

Comma-separate joins all non-blank lines into a single comma-separated list: "apple, banana, cherry". This is useful for creating SQL IN clauses, CSV values, or JavaScript arrays from a list of items.