How to use the sort & clean lines tool
- Paste your list. Drop in text or a file with one item per line (or change the input separator).
- Pick a sort order. Alphabetical, natural (so “Item 2” comes before “Item 10”), numeric, by length, reversed or shuffled randomly.
- Tidy the items. Trim spaces, remove empty lines and duplicates, change the case, add prefixes or suffixes, wrap items in quotes or number them.
- Copy the result. Copy it or download it as a text file, or use “Use output as input” to chain more clean-ups.
Common uses
- Alphabetise names, tags, glossary terms or reference lists
- Sort numbers correctly (2 before 10) with natural or numeric sorting
- Randomise the order of a list for draws, quizzes or testing
- Prepare lists for code: add quotes and commas around every item
Frequently asked questions
How do I sort lines alphabetically?
Paste the list and choose A → Z (or Z → A). Sorting ignores letter case so Apple and banana sort the way you expect.
What is natural sort?
Natural sort compares the numbers inside text as numbers, so “Item 2” comes before “Item 10” instead of after “Item 1”.
How do I sort numbers correctly?
Use “Numeric low → high” or “high → low”. Text lines that are not numbers are placed at the end.
Can I shuffle or randomise a list?
Yes, choose “Shuffle randomly”. Each change to the input or options produces a fresh shuffle.
Can I add numbers or quotes to each line?
Yes. “Number the items” adds 1., 2., 3. and “Wrap each item” adds quotes, brackets or backticks; combine with an output separator of comma to build code-ready lists.
Does it change my original text?
No. Your input is untouched; the sorted result appears in the output box.
More tools: Email Extractor · Compare Lists · Remove Duplicates · Sort Lines · List Converter