FileGizmo Text tools

Sort text lines

Sort lines alphabetically or naturally with stable ordering and optional blank-line removal in your browser. Natural order puts item 9 before item 10.

Never uploadedYour file stays on this device

Simple by design

Sort lines in three steps

FileGizmo sorts newline-separated text without uploading lists, identifiers, filenames, or private notes. Paste one value per line, choose ascending or descending direction, and select alphabetical or natural comparison. Natural order understands embedded numbers, so chapter2 appears before chapter10; alphabetical order follows locale-aware text comparison.

The sort is stable. When two lines compare equally, their original order is preserved, making results predictable when case or repeated values are involved. Optional case-sensitive comparison distinguishes uppercase and lowercase values. You can also remove empty lines before sorting while leaving all non-empty content unchanged. Leading and trailing spaces remain part of a line unless blank-line removal identifies a line containing only whitespace.

Processing runs in a browser worker so long lists do not freeze the page. The result summary reports how many lines were sorted and how many blanks were removed. Copy the output or download a UTF-8 text file. For locale-specific dictionaries or domain rules, review the result because browser collation may differ from a specialized database sort.

Alphabetical sorting compares text character by character, which puts item10 before item9 because the character 1 comes before 9. Natural sorting reads the digits as numbers and puts them in the order a person would, which is almost always what is wanted for filenames, version strings, and anything ending in a counter.

The sort is stable. Lines that compare as equal keep the order they arrived in, so sorting a list that was already grouped does not scramble the groups. Reversing is a separate switch rather than a separate sort, so the stability holds either way.

Blank line removal is optional and applied after sorting, which keeps the result predictable when a list has been padded for readability. Leading and trailing whitespace is compared as written, so a line indented by a spreadsheet export will not silently jump position.

Typical uses are import lists in code, filenames pulled from a directory listing, and reference lists that have to be alphabetical before publication. All of these are quick by hand until the list passes about twenty entries, at which point doing it manually reliably introduces a mistake.

Sorting happens in the page, so a list of internal hostnames or unpublished filenames does not travel anywhere to be put in order.

  1. 1

    Paste one item or value per line

  2. 2

    Choose alphabetical or natural order and direction

  3. 3

    Sort copy or download the result

Good to know

Frequently asked questions

What is natural sorting?

Natural sorting places values such as item2 before item10 while still comparing text.

Is the sort stable?

Yes. Lines that compare equally retain their original relative order.

Can blank lines be removed?

Yes. Enable blank-line removal before sorting when you want a compact list.

Does FileGizmo upload the list?

No. Sorting runs locally in a dedicated browser worker.