Text and Data Tools

Text Sorter

Reorder multiline lists alphabetically, naturally, numerically, by length, or with a random shuffle.

Input Text

Result

Sort multilingual lines by text, natural or numeric order, or character length, or shuffle them randomly.

Your input is processed only in your browser and is never uploaded to a server.

About This Tool

Text Sorter offers comparison methods for different kinds of lists. Text and natural sorting use Intl.Collator, numeric sorting compares numeric values, and random mode uses Fisher-Yates instead of a biased random comparator.

How to Use It

  1. Enter one item per line.
  2. Choose ascending, descending, length, natural, numeric, or shuffle mode.
  3. Adjust case sensitivity, comparison trimming, and blank-line handling as needed.
  4. Click Sort, check the result, and copy or download the TXT output.

Examples

  • The text order 1, 10, 2 becomes 1, 2, 10 in numeric mode.
  • Natural sorting orders file10, file2, file1 as file1, file2, file10.
  • Shuffling changes the order but keeps every line not excluded by the blank-line option.

Rules and Limits

Intl.Collator provides multilingual comparison; natural sorting enables numeric comparison. Length is measured in Unicode code points, so an emoji’s UTF-16 surrogate pair is not counted as two code points. Numeric mode rejects invalid numbers. Trimming can affect comparison keys while output retains the original text. Original indexes keep equal items stable; shuffle mode swaps randomly chosen positions. Numeric mode uses JavaScript Number precision. Numbers beyond safe integer precision should be handled as text first.

Common Uses

  • Organize filenames, version strings, or numbered lists.
  • Compare variable names or copy by length.
  • Shuffle practice questions or ordinary display lists.

Privacy

Text processing, file reading, conversion, and previews all run locally in this browser. Input is not uploaded or automatically saved. No backend, database, online API, or third-party CDN is used. Copying and downloading also happen locally.

FAQ

How does natural order differ from text order?

Text order compares characters. Natural order treats consecutive digits as numeric parts, placing file2 before file10.

Why does 10 sometimes come before 2?

Text comparison starts with the first character, and 1 precedes 2. Select numeric or natural sorting for the order you need.

Can numeric mode sort arbitrary text?

No. A line that is not a finite number produces a visible error instead of an unpredictable ordering.

How does random shuffle work?

It uses Fisher-Yates swaps, not a random array.sort comparator. It is intended for ordinary list shuffling, not passwords or a prize-drawing system.

Back to Developer Tools