TheTools.World tool

Sort text lines online

Sort a list of lines alphabetically, A to Z or Z to A, with an option to ignore case and to drop blank lines. Useful for cleaning up lists, spreadsheet columns, and reference data pasted as plain text.

Sort your lines

Sort a list of lines alphabetically, A to Z or Z to A, with an option to ignore case and to drop blank lines. Useful for cleaning up lists, spreadsheet columns, and reference data pasted as plain text.

How to sort lines

  1. Paste your list, one item per line, into the box.
  2. Choose A to Z or Z to A order.
  3. Decide whether case should be ignored when sorting (recommended for most lists).
  4. Decide whether to remove empty lines.
  5. Click Sort lines and copy or download the result.

Sorting uses your browser's locale-aware comparison, so accented letters and most non-English alphabets sort in a reasonable order, not strict raw character-code order.

How the sort works

Your text is split into lines, then compared using your browser's locale-aware string comparison (via the Intl.Collator API) rather than raw character-code sorting. This means accented letters generally sort next to their unaccented equivalents (so "café" sorts near "cafe", not off at the end near symbols), which matches how most reference lists are expected to sort. With case-insensitive sorting on, "Apple" and "apple" are treated as equal for ordering purposes.

Best practices

Common mistakes to avoid

Real-world use cases

Limitations

This is a plain alphabetical sort, not a numeric or natural sort — a list like "item 2, item 10, item 1" will sort as "item 1, item 10, item 2" because it compares text character by character, not by numeric value. It also sorts by the whole line, so it cannot sort multi-column data by a specific column.

Privacy

Text you sort is processed locally in your browser. It is not sent to a server, logged, or stored. See the privacy policy for the site's full data handling approach.

Troubleshooting

Conclusion

Use this tool to alphabetize any plain-text list. To also remove duplicate entries, use remove duplicate lines; to reverse the order of lines without sorting them, use reverse text in line mode.

FAQ

Does this sort numbers correctly?

No, this is an alphabetical sort, so "10" will sort before "2". For numeric order you would need a spreadsheet or a dedicated numeric sort tool.

Can I remove duplicates while sorting?

This tool only sorts. Use remove duplicate lines separately (before or after sorting) if you also need duplicates removed.

How does case-insensitive sorting work?

With it enabled, "Apple" and "apple" are treated as equal for ordering purposes, so the list is sorted as if everything were the same case.

Is my text uploaded anywhere?

No. Sorting happens locally in your browser and your text is not sent to a server.