Sort Lines Alphabetically
Sort Lines Alphabetically
Put any list in order — A to Z, Z to A, or by line length. Optional natural sorting handles numbers inside lines correctly. All in your browser.
An unsorted list is hard to scan and easy to get wrong. Names, products, keywords, file names, and to-do items are all easier to check, share, and import once they follow a clear order. Sorting by hand works for a dozen lines; beyond that it wastes time and still leaves mistakes. This tool puts every line in order instantly, with the kind of control a plain alphabetical sort does not give you.
As well as the standard A to Z and Z to A orders, you can sort by line length — shortest first is useful for keywords and tags, longest first helps you find over-length entries that break layouts or exceed limits. Natural sorting fixes the classic computer mistake where "Item 10" is placed before "Item 2": with natural sort on, numbers inside text are compared by value, so numbered lists, chapters, and versions come out in the order a human expects.
Two tidy-up options ride along: remove blank lines, and remove exact duplicates while sorting, so a messy pasted list comes out clean and ordered in one pass. Case-sensitive sorting is available for technical lists where capitalisation carries meaning, such as codes or variable names.
Everything happens in your browser. Your list is never uploaded or stored.
How to use
- Paste your list into the top box, one item per line.
- Choose the sort order: alphabetical either way, or by line length.
- Leave natural sort on for numbered items, and tick the duplicate and blank-line options if you want a clean-up too.
- Click Sort Lines and review the result.
- Copy the sorted list wherever you need it.
Frequently asked questions
What is natural sorting?
Normal sorting compares text character by character, so "10" comes before "2" because it starts with "1". Natural sorting recognises numbers inside the text and compares them by value, giving 1, 2, 10, 20 in the order you expect.
Where do capital letters sort?
With case-sensitive sorting off (the default), capitals and small letters are treated as equals and the order is purely alphabetical. With it on, the browser's locale rules apply capitals-first ordering within the alphabet.
Does sorting change my lines?
No. Sorting only reorders lines; it never edits their content. The only removals are the ones you ask for — blank lines and duplicates — via the checkboxes.
Is my list private?
Yes. Sorting runs locally in your browser on this page. Nothing is sent to a server, and nothing remains after you close the tab.