Select language

Interface controls and tool names are translated. Detailed instructions, legal text and some form labels remain in English. Your files are not translated.

Easy To Use - 140+ Free Online Tools

Sort Text Lines

Sort lines alphabetically or naturally with numbers.

Drop your files here

or

Choose files

Max 100 MB per file · TXT, TEXT, LOG

    Text options

    UTF-8 files only. Up to 300,000 characters per file.

    Your file is ready!

    Download
    Free No watermark No sign-up Files never uploaded
    Order looks wrong?A leading space changes the order — use Trim Text Lines first.
    Repeated lines?Combine with Remove Duplicate Lines.
    Room 10 before Room 2?Turn on natural number order.

    How to use Sort Text Lines

    1. Select your text files.Add UTF-8 lists up to 2 MB: names, words, products or keywords.
    2. Choose how to sort.Pick the language, and tick natural number order or reverse order if you need them.
    3. Click Sort Text Lines.Line endings and the final newline of your file are kept.
    4. Check the line order.Lines are sorted A to Z (or Z to A if reversed).

    About Sort Text Lines

    When is it useful? Sort Text Lines puts the lines of a text file in alphabetical order — for name lists, word lists, product lists, keywords, glossaries and lists you want to compare.

    Good to know: “Natural number order” sorts item 2 before item 10, the way people expect; turn it off for strict character order. Tick “Reverse order” for Z to A. Choose the text language for correct alphabetical rules. Line endings and the final newline of your file are kept.

    Example: a list of 200 student names was typed in random order. Sort it with “Natural number order” on, and names with numbers such as Room 2 and Room 10 appear in the order people expect, ready to print as an attendance sheet.

    Tips for Better Results

    • Remove extra spaces first with Trim Text Lines — a leading space changes the order.
    • Combine with Remove Duplicate Lines for a clean, unique list.
    • The file must be UTF-8 and up to 2 MB.

    Frequently Asked Questions

    What is natural number order?
    It sorts item 2 before item 10, the way people expect. Turn it off for strict character order.
    How do I sort Z to A?
    Tick “Reverse order”.
    Why is one line in the wrong place?
    A leading space changes the order. Run Trim Text Lines first.
    Works with: Notepad · TextEdit · VS Code · Excel imports · most text editors

    What converts well, and what doesn't

    SettingResult
    “Natural number order”Item 2 before item 10
    Natural order offStrict character order
    “Reverse order”Z to A
    Text languageCorrect alphabetical rules
    Line endings and final newlineKept
    💡 Tip: Natural number order puts Room 2 before Room 10, the way people expect.

    Common uses

    Name listsAlphabetical order.
    Word listsSorted words.
    Product listsEasy to find.
    KeywordsSorted keywords.
    GlossariesA to Z.
    Attendance sheetsReady to print.

    Is my file safe?

    Browser processing: your files are processed on your own device and are never uploaded to our server.

    Advertisement
    Guide

    Sort Text Lines: a complete guide

    Why sort lists

    Sorted lists are easier to read, search and compare: student or employee names, product and inventory lists, word lists, keywords, glossaries, file lists and logs. Sorting also makes duplicates appear next to each other.

    How it works

    Upload a UTF-8 .txt file of up to 2 MB. Each line is treated as one item and sorted alphabetically using the rules of the language you choose. “Natural number order” sorts numbers the way people expect (item 2 before item 10). “Reverse order” sorts from Z to A. The line-ending style and final newline of your file are kept.

    Language-aware sorting

    Alphabetical order differs between languages: accented letters, special letters such as German ß or Turkish ç, and scripts such as Hindi or Tamil have their own order. Choosing the text language uses the correct order for that language rather than simple character codes.

    Common problems and how to fix them

    Some lines appear at the top unexpectedly: they begin with spaces, numbers or symbols — trim spaces first with Trim Text Lines. Upper- and lowercase versions sort apart: lowercase the list first if case should not matter. A list of numbers sorts as 1, 10, 2: turn on Natural number order.

    Good habits

    Trim and clean the list before sorting, remove duplicates afterwards, and keep the original order in a separate file if it matters.

    Advertisement