text-sorter text-utility sorting json data-cleaning

How to Sort Text, Numbers, and JSON Arrays Online

A practical guide to sorting multiline text, numeric lists, and JSON arrays safely in the browser with predictable options.

T3 Tool3M Editorial Team Reviewed technical guide 2026-04-25 2 min read Reviewed by Tool3M Maintainers Use This Tool

Why sorting deserves a dedicated tool

Lists appear everywhere in technical work: exported identifiers, log fragments, package names, spreadsheet columns, HTTP header names, configuration keys, and JSON arrays copied from an API response. A small inconsistency can create noisy diffs, duplicate work, or failed imports. Text Sorter exists for this narrow but common job: paste data, choose the structure, and produce a predictable order without writing a one-off script.

The key is structure awareness. Plain text lines are not the same as numbers, and neither is the same as JSON. Text comparison is usually human oriented and may ignore case. Numeric comparison must treat 10 as greater than 2. JSON arrays need parsing before transformation so invalid input is caught before a result is shown.

Working with multiline text

Multiline mode treats each line as one item. This is useful for names, slugs, domains, environment variable keys, search terms, and manual notes. Trimming removes accidental spaces at the beginning or end of each line. Ignoring empty lines keeps copied spreadsheet ranges from producing blank output items.

Working with numbers

Numbers should be compared numerically, not alphabetically. Alphabetic ordering places 10 before 2, which surprises users sorting counts, IDs, priorities, or numeric fragments. Number mode validates every non-empty line as a finite number and reports an error when mixed content appears.

Working with JSON arrays

JSON mode expects an array because array order is an explicit JSON concept. The tool does not infer business keys from arbitrary objects. When entries are objects, they are compared with a stable key-sorted representation while the output preserves the original JSON values.

Privacy and browser-side processing

The transformation runs in the browser. Pasted content is not uploaded to Tool3M for processing. This is suitable for everyday snippets, although users should still follow their own security policy before pasting sensitive data into any web page.

Use the tool

Open the Text Sorter, paste your data, load the demo if you want a quick example, then copy the generated output. Keep the options visible while reviewing the result so future runs can be repeated with the same assumptions.