Text Sorter тАФ Sort lines or CSV by preset or regex

Sort lines or CSV rows by preset or regex key. Paste text or import CSV. Free, no sign-upтАФruns in your browser.

Sort lines or CSV by preset or regex. Free, no sign-up, in your browser.

Sort lines or CSV rows with presets (AтАУZ, length, numeric, random) or extract a sort key with regex. Paste text or import a CSV file. All processing in your browserтАФno upload.

рдЯреВрд▓ рд▓реЛрдб рд╣реЛ рд░рд╣рд╛ рд╣реИтАж

Use it for

  • Lists тАФ sort lines AтАУZ or by length
  • CSV тАФ sort rows then export again
  • Custom key тАФ use regex to extract a sort key
  • Random order тАФ shuffle a list

1. What does this tool do

This free online text sorter lets you sort lines or CSV rows by a preset (AтАУZ, ZтАУA, shortest first, longest first, numeric, or random) or by a regex-extracted key. You can paste text (one item per line) or import a CSV file; each line or row is one chunk. After sorting, you can copy the result or export it as CSV. No sign-up, no upload; all processing runs in your browser.

2. How to use it

Quick start: Choose Paste text or Import CSV, add your input, pick Preset or Regex sort mode, then click Sort. Copy or export the result.

  1. Input тАФ Paste text: type or paste with one item per line. Optionally trim lines and omit empty lines (both default on). Import CSV: click Import CSV and select a file; each row becomes one chunk.
  2. Sort mode тАФ Preset: choose AтАУZ, ZтАУA, Shortest first, Longest first, Numeric, or Random. Regex: enter a pattern (e.g. (\d+) to sort by the first number in each chunk), set flags (g, i, m), and optionally tick тАЬSort key numericallyтАЭ.
  3. Click Sort тАФ The tool sorts the chunks and shows the result.
  4. Copy or Export тАФ Copy the sorted list (newline-separated) or click Export CSV to download (optionally with an index column).

3. How it works

  • Chunks from text тАФ The input is split by newlines. Each line is trimmed (if тАЬTrim linesтАЭ is on) and empty lines are dropped (if тАЬOmit empty linesтАЭ is on). The resulting list is the set of chunks.
  • Chunks from CSV тАФ The CSV is parsed (headers and rows). Each row is turned into one string (cells joined by comma). That list is the set of chunks. Headers are not treated specially; the first row can be included or excluded depending on your CSV.
  • Preset sort тАФ AтАУZ / ZтАУA: localeCompare. Length: by string length ascending or descending. Numeric: parseFloat on the whole chunk; non-numeric chunks sort last. Random: FisherтАУYates shuffle.
  • Regex sort тАФ For each chunk, the pattern is run once. If there is a first capture group, its value is the sort key; otherwise the full match; if there is no match, the whole chunk is the key. Chunks are then sorted by that key (as string or number if тАЬSort key numericallyтАЭ is on). Invalid regex or over-length input returns an error.

Export CSV тАФ Same format as the Text Splitter: one row per chunk, optional index column, RFC 4180 escaping.

All computation runs in your browser. No data is sent to any server.

4. Use cases & examples

  • Word or line lists тАФ Paste a list, sort AтАУZ or by length.
  • CSV rows тАФ Import a CSV, sort rows by the whole row string (e.g. AтАУZ), then export again.
  • Sort by number in line тАФ Use regex mode with a pattern like (\d+) and тАЬSort key numericallyтАЭ to order lines by the first number in each line.
  • Random order тАФ Use Random preset to shuffle a list.

Example (Preset AтАУZ):
Input lines: zebra, apple, mango
Result: apple, mango, zebra

Example (Regex item-(\d+), numeric):
Input: item-30, item-10, item-20
Keys: 30, 10, 20 тЖТ Result: item-10, item-20, item-30

5. Limitations & known constraints

  • Input cap тАФ Total text length (all chunks combined) limited to 100,000 characters in regex mode; preset mode has no extra limit beyond normal UI responsiveness.
  • Regex тАФ Pattern limited to 500 characters; same validation as Regex Cleaner. Invalid pattern or over-length input shows an error.
  • Client-side only тАФ No server; processing runs in the browser.
  • CSV тАФ One chunk per row; тАЬsort by columnтАЭ (reorder rows by a chosen column) may be added in a future update.

рддреНрд╡рд░рд┐рдд рдЙрддреНрддрд░

рд╕рднреА рдЧрдгрдирд╛ рдФрд░ рд░реВрдкрд╛рдВрддрд░рдг рдкреВрд░реА рддрд░рд╣ рдЖрдкрдХреЗ рдмреНрд░рд╛рдЙрдЬрд╝рд░ рдореЗрдВ рдЪрд▓рддреЗ рд╣реИрдВред рдХреЛрдИ рдбреЗрдЯрд╛ рдХрд┐рд╕реА рд╕рд░реНрд╡рд░ рдХреЛ рдирд╣реАрдВ рднреЗрдЬрд╛ рдЬрд╛рддрд╛, рдЗрд╕рд▓рд┐рдП рдЖрдкрдХреА рдЗрдирдкреБрдЯ рдХрднреА рднреА рдЖрдкрдХреЗ рдбрд┐рд╡рд╛рдЗрд╕ рд╕реЗ рдмрд╛рд╣рд░ рдирд╣реАрдВ рдЬрд╛рддреАред