Sort Lines
🔒 In your browserSort lines A–Z, by length, reversed or shuffled — with natural ordering.
How it works
Sort lines alphabetically, by length, in reverse or at random. Handy for tidying lists, imports, CSV columns and config files.
Try an example
—🔒 Processed entirely in your browser — your text is never uploaded or stored.
About the Sort Lines
This free line sorter puts a list in order — alphabetically, by length, reversed, or shuffled at random. It handles natural ordering, so item9 comes before item10 rather than after item1, and can remove duplicates and trim stray whitespace in the same pass.
Sorting happens in your browser, so even long or sensitive lists never leave your device.
Sort options
- A → Z and Z → A alphabetical ordering.
- Shortest or longest line first.
- Reverse the current order, or shuffle randomly.
- Natural ordering so numbers inside text sort as numbers.
- Optionally remove duplicates and trim surrounding whitespace.
Sorting options
- A→Z and Z→A alphabetical order.
- Shortest or longest line first.
- Reverse the current order, or shuffle randomly.
- Natural order, so item9 comes before item10 rather than after item1.
- Optionally remove duplicates and trim whitespace in the same pass.
Frequently asked questions
How do I alphabetize a list?
Paste your list, choose A → Z, and the sorted result appears immediately, ready to copy.
What is natural ordering?
It sorts embedded numbers by value rather than as text, so item2 comes before item10. Plain alphabetical sorting would put item10 first because '1' sorts before '2'.
Can I sort and remove duplicates at once?
Yes. Tick 'Remove duplicates' and the list is deduplicated as part of the same operation.
Is my list uploaded?
No. Sorting runs entirely in your browser.
What is natural ordering?
It sorts embedded numbers by value rather than as text, so item2 comes before item10. Plain alphabetical sorting would put item10 first because the character 1 sorts before 2.
Related searches
Related Text tools
🔗 Embed this tool on your website — free
Copy this and paste it into your page's HTML. The tool runs in the visitor's browser, just like here. Change height to fit, or add the optional auto-resize snippet below. Add ?theme=dark to the URL for dark mode.
<iframe src="https://toolhq.dev/embed/sort-lines/" title="Sort Lines — ToolsHub" width="100%" height="520" style="border:1px solid #e5e7eb;border-radius:12px;max-width:680px" loading="lazy"></iframe>Optional: auto-resize the iframe height
Add this once on the same page so the iframe grows to fit the tool:
<script>
addEventListener("message", function (e) {
if (e.data && e.data.type === "toolshub:resize") {
document.querySelectorAll('iframe[src*="/embed/"]').forEach(function (f) {
if (f.contentWindow === e.source) f.style.height = e.data.height + "px";
});
}
});
</script>