Skip to content
Marvin's Toolbox.

Search tools

Type to filter all tools

Sort Lines

Sort the lines of a text alphabetically, naturally, by length, by numeric value or shuffled. Reverse the order with a switch, and optionally trim lines, drop blank lines and remove duplicates in the same pass.

Everything runs locally in your browser. Your data never leaves your device.

Sort by

A to Z, ignoring case.

Clean up first

Next steps

Send this tool's output straight into another tool.

Convert text into every case at once: title case in the APA, AP, Chicago, MLA, Bluebook, AMA and NYT styles, sentence case, upper, lower, camelCase, snake_case, kebab-case and more.

Count words, characters, sentences, paragraphs, lines and more as you type, with estimated reading and speaking time.

Remove duplicate lines from a list or text, keeping the first occurrence. Optionally ignore case and whitespace, or drop blank lines too.

Replace text in two modes: plain find and replace all, or regular expressions with flag controls and capture group references like $1.

Compare two texts and see every added, removed and changed line highlighted, side by side or inline, with the changed words marked within each line. Ignore case, whitespace or blank lines, read a summary of how much changed, and export the result as a unified diff.

Paste a UUID to see what it carries: version, variant, and for time-based versions the exact timestamp, clock sequence and node. Also shows the raw bytes, the 128-bit integer and the URN form.

Decode Base64 to text or encode text to Base64. Paste into the top box, read the result below, and flip the direction with one click. Handles Unicode correctly, reads URL-safe Base64, and shows binary payloads as a hex dump you can download.

Convert numbers between binary, octal, decimal, hexadecimal and any base up to 36. Type into any field and the others update as you go. Handles huge integers without losing precision and accepts 0x, 0b and 0o prefixes.

Convert between scientific notation and full numbers as you type. Reads 1.23e5, 1.23 × 10^5 and plain numbers, shows the value written out, in normalized scientific notation and in engineering notation, and can round to any number of significant digits.

About the Sort Lines Tool

This tool sorts the lines of a text. Pick alphabetical, natural, line length, numeric or a random shuffle, flip the whole order with the reverse switch, and optionally trim lines, drop blank lines and remove duplicates in the same pass.

Natural sort is the one to reach for when your lines contain numbers: it puts item 2 before item 10, where plain alphabetical sorting does not.

What you can do

  • Sort lines alphabetically from A to Z or Z to A.
  • Sort file names and numbered items in natural order.
  • Sort lines by length, shortest or longest first.
  • Sort lines by the number they start with.
  • Shuffle lines into a random order.
  • Trim whitespace, drop blank lines and remove duplicates while sorting.

How to use the Sort Lines

  1. 1Paste your lines into the input box.
  2. 2Pick the sorting method, and reverse it if you need the other direction.
  3. 3Tick the cleanups you want: trim, remove blank lines, remove duplicates.
  4. 4Copy or download the sorted result.

How the methods compare

Alphabetical compares letter by letter and ignores case. Natural does the same but reads runs of digits as numbers, so version 2 sorts before version 10. Numeric looks only at the number a line starts with, which suits price lists and rankings, and lines without a leading number go to the end. Length orders by how long each line is, with ties broken alphabetically. Random shuffles fairly, and the shuffle button deals a new order each time.

If you only need duplicates removed without reordering anything, the Dedupe Lines tool keeps your original line order.

Decode Base64 to text or encode text to Base64. Paste into the top box, read the result below, and flip the direction with one click. Handles Unicode correctly, reads URL-safe Base64, and shows binary payloads as a hex dump you can download.

Format code in JavaScript, TypeScript, JSON, JSON5, HTML, Vue, CSS, SCSS, LESS, Markdown, YAML, GraphQL, XML and SQL. Pick tabs or spaces, set the indent width, and format the input in place with one click.

Remove duplicate lines from a list or text, keeping the first occurrence. Optionally ignore case and whitespace, or drop blank lines too.

Replace text in two modes: plain find and replace all, or regular expressions with flag controls and capture group references like $1.

Escape text into HTML entities or decode entities back to plain text. Choose named or numeric entities, escape only the unsafe characters or everything outside ASCII, and read the result live.

Reveal the characters you can't see in a text: zero-width spaces, non-breaking spaces, bidi marks, control characters and CRLF versus LF line endings. Inspect every occurrence and clean them out with a click.