Text

Text Sorter

Sort lists, logs, and one-item-per-line data with natural order (so file2 comes before file10), plain A–Z text order, or numeric-by-line mode. Choose ascending or descending, optional case-insensitive collation, trim-aware comparison, and whether blank lines sink to the bottom. Everything runs in your browser — nothing is uploaded to DroidXP.

Ad placement — top banner

Natural is best for filenames and mixed text+digits. Numeric ranks lines that parse as numbers before non-numeric lines.

Ad placement — mid rectangle

What does this tool do?

It reorders your text line by line. Each line is one unit — ideal for sorted lists, priority queues pasted from a spreadsheet, log levels, build numbers, or paths and filenames where digit order matters (use Natural so item_2 sorts before item_10).

Natural vs alphabetical vs numeric

Natural uses the browser’s locale-aware localeCompare with numeric: true, so embedded numbers sort in numeric order. Alphabetical compares the full string without that digit-aware rule (so file10 can appear before file2 in strict string order). Numeric mode treats a line as a number when the trimmed content parses as a finite number; those lines sort by value, and any other lines are ordered after them using string comparison.

Order, case, trim, and blanks

Ascending and descending flip the comparison direction. Case-insensitive applies to Natural and Alphabetical modes (it is hidden in Numeric mode). Trim before compare ignores leading and trailing whitespace when deciding order but leaves your original line text in the output. With blank lines to bottom, lines that are empty or only whitespace are collected and appended after all non-blank lines, preserving their relative order among themselves.

Relationship to other text tools

Pair this with the Duplicate Line Remover when you need a sorted unique list (dedupe there, or sort after dedupe). Use the Slug Generator when you need URL segments rather than sorted lines.

How to use this tool

  1. Step 1: Paste text with one logical item per line (try Load sample).
  2. Step 2: Pick Natural, Alphabetical, or Numeric; set order and options.
  3. Step 3: Copy the sorted output into your editor, CSV, or script.
  4. Step 4: For very large files, prefer a desktop or command-line sort; browsers may slow on huge pastes.

Frequently Asked Questions

Does DroidXP upload my text?

No. Sorting runs entirely in your browser. Drafts may be saved in localStorage on this device only.

What is the difference between Natural, Alphabetical, and Numeric sort?

Natural uses locale-aware comparison with numeric ordering so file2 sorts before file10. Alphabetical compares full strings without digit-aware rules. Numeric sorts lines that parse as numbers by value, then orders remaining lines with string comparison.

When should I use case-insensitive sorting?

Use it for Natural and Alphabetical when you want Banana and banana to sort together. It is not shown in Numeric mode because ordering is driven by numeric values.

What does “trim before compare” do?

It ignores leading and trailing spaces when comparing lines; the output still shows each line as you pasted it (unless the sort only reorders — spacing per line is preserved).

How are empty or blank lines handled?

With blank lines to bottom on, whitespace-only lines are moved after all other lines. With it off, blanks participate in the main sort (empty keys typically sort first). Multiple blank lines keep their relative order where possible thanks to stable sorting.

What localStorage keys are used?

Keys are prefixed with droidxp-ts-: input text, mode, order, case-insensitive, trim compare, and blank-line option. Clear removes them.

Is JavaScript sort stable?

Yes in modern browsers: lines that compare as equal keep their input order, which matters when you rely on tie-breaking.

Do Windows (CRLF) line endings matter?

Lines are split on \n and \r\n. A trailing \r belongs to the line unless you trim for comparison.

Will this work with Unicode and emoji?

Yes. Lines are JavaScript strings. Collation follows the browser and locale; verify edge cases for specialized scripts if order is legally or linguistically sensitive.

Is this safe for confidential lists?

Follow your policy. Nothing is sent to DroidXP, but screen capture, extensions, and backups can still expose clipboard or page content.

Can I use this offline?

After the page is cached, it can work offline. No network is required for sorting.