Convertful
ImagePDFVideoUtilityBlog

Image Tools

  • Compress Image
  • Resize Image
  • Remove Background
  • HEIC to JPG
  • All Image Tools →

PDF Tools

  • Compress PDF
  • Merge PDFs
  • Split PDF
  • PDF to Images
  • All PDF Tools →

Video & Audio

  • Video to GIF
  • Compress Video
  • Trim Video
  • Extract Audio
  • All Video Tools →

Utility

  • QR Code Generator
  • JSON Formatter
  • Color Converter
  • All Utility Tools →
All processing happens in your browser. Your files never leave your device.
AboutBlogTermsPrivacyContact
© 2026 Convertful. All rights reserved.
HomeUtilitySort Lines

Sort Lines

Sort text lines alphabetically, numerically, or by length. Free, private, runs in your browser.

100% private — your files never leave your browser. All processing happens locally on your device.

Sort Settings

Paste lines above to sort them.

You might also need

Remove Duplicate LinesDedupe lines with optional trimming and sorting
Remove Empty LinesStrip blank lines or collapse consecutive empties
Trim WhitespaceTrim, collapse, and clean whitespace from text
Text ReverserReverse text by characters, words, lines, or sentences

Why Sort Lines?

Sorting is one of the most common text-cleanup tasks: ordering a list of names, organizing TODOs, preparing data for comparison, deduplicating entries, or just making output easier to scan. A dedicated line-sort tool saves you from pasting into Excel or opening a script — paste, pick an order, copy.

Alphabetical vs Natural Sort

Alphabetical (lexicographic) sort compares strings character-by-character, which is why `file10.txt` comes before `file2.txt` — the digit `1` is less than `2`. Natural sort understands numbers and produces the human-expected order: `file1`, `file2`, `file10`. Use natural for filenames, version strings, and anything with embedded numbers; use alphabetical for strictly textual lists.

Advanced Sort Options

Beyond A-Z and Z-A, the tool offers numeric sort (treat lines as numbers, skip non-numeric), length sort (shortest to longest, or reverse), and random shuffle (good for unbiased sampling). Toggle trim-before-compare to ignore leading and trailing whitespace, and case-sensitive to use strict ASCII order where uppercase letters precede lowercase.

Is My Data Safe?

Yes. Sorting runs entirely in your browser using JavaScript's built-in sort. No text leaves your device. Paste proprietary lists, customer data, or API keys — the tool never sees anything except what's already in your browser's memory.

FAQ

What's the difference between alphabetical and natural sort?

Alphabetical treats numbers as text, so `10` sorts before `2`. Natural sort understands numbers — `2`, `10`, `100` come out in human-expected order, which is what you usually want for filenames like `img1`, `img2`, `img10`.

Does it preserve duplicates?

By default yes. Enable 'Remove duplicates' to keep only one copy of each line after sorting.

How does case affect the sort?

Case-insensitive by default — `Apple`, `banana`, `Cherry` sort naturally. Toggle case-sensitive to use strict ASCII order, where uppercase letters come before lowercase.