Sort Lines
Your input stays in your browser and is never sent.Sort lines alphabetically, naturally or by length. Also removes duplicate and empty lines.
- Enter
- See the result
What the line sorter can do (alphabetize, dedupe, and clean up lists)
The line sorter treats whatever you paste as a list with one entry per line and reorders it however you like. You can alphabetize the list, sort it in natural order so numbering reads correctly, or sort by how long each line is, in ascending or descending order. While it sorts, it can also drop duplicate lines, drop blank lines, and trim stray spaces, so you do not have to move between several tools to tidy one list. Everything runs inside your browser. No sign-up, and it's free.
How to alphabetize a list in three steps
- Paste your list with one entry per line, or use "Open file" to open a text file.
- Pick what to sort by (alphabetical, natural, or length) and the order. The result appears immediately on the right.
- Copy the result, or save it as a text file.
Remove duplicate lines and blank lines from a list
Lists assembled from several sources usually carry the same entry more than once, along with blank lines left behind by copying. Removing duplicates keeps the first occurrence of each line and drops the rest. Removing blank lines covers both truly empty lines and lines that contain only spaces. The tool reports how many lines went in, how many came out, and how many duplicates and blank lines it removed, so you can confirm nothing unexpected disappeared.
Ignore case when removing duplicate lines
Email addresses and product codes often appear twice with nothing but a capital letter separating them. Tick "Ignore case" and "Apple" and "apple" are treated as the same entry, keeping whichever spelling appeared first.
Trim spaces at the start and end of each line before comparing
Text pasted from a spreadsheet or a PDF frequently ends with invisible spaces or tabs. Two lines that look identical are then treated as different, and duplicate removal silently does nothing. Turning on trimming cleans each line before the comparison, which usually explains why a list "would not deduplicate".
Sorting Japanese text in kana order
Japanese hiragana and katakana sort correctly in kana order with no extra setup. Kanji is a different matter: a kanji character carries no reading, so a browser-only tool cannot know that a name written in kanji should sort by its pronunciation. That is the trade-off for never sending your list anywhere. If you need a Japanese name list in kana order, put the reading at the start of each line and sort on that.
Converting line break codes or counting characters
- Line Break ConverterChange which characters end each line, rather than reorder the lines, by switching between CRLF, LF and CR.
- Line Break RemoverStrip the stray breaks that appear when copying out of a PDF.
- Character CounterSee the length and line count of your text.
- Fullwidth / Halfwidth ConverterEven out text that mixes full-width and half-width characters.
Why SOKUFU's line sorter is safe
Many online tools upload your data to an external server for processing. This tool never sends your text to a server: everything happens inside your browser, so there is no risk of leaks in transit or from storage on a server.
Line sorter FAQ
Can names written in kanji be sorted in kana order?
Not correctly. A kanji character carries no reading, so a browser-only tool cannot read 山田 as "yamada". To sort a Japanese name list in kana order, put the reading at the start of each line (e.g. "やまだ 山田太郎"). Lines written only in hiragana or katakana sort correctly.
What is the difference between alphabetical and natural order?
They differ in how numbers are handled. Alphabetical order compares text one character at a time, so "item10" lands before "item2" because the character "1" comes before "2". Natural order reads a run of digits as a single number, so you get item1, item2, item10. Use natural order whenever your list contains numbering, dates, or product codes.
Which copy of a duplicate line is kept?
The first one. Duplicates are removed before the list is sorted, so the line that appeared earliest in your original text is the one that survives, regardless of where it ends up after sorting.
Can I treat "Apple" and "apple" as the same line?
Yes. Turn on "Remove duplicate lines" and then tick "Ignore case". The two lines are then treated as one, and the spelling that appeared first is kept.
My list looks like it has duplicates, but nothing is removed. Why?
The lines probably differ by invisible whitespace. Lists pasted out of a spreadsheet or a PDF often carry trailing spaces or tabs. Tick "Trim spaces at the start and end of each line" so the lines are cleaned up before they are compared.
Is my list uploaded to a server?
No. Sorting, deduplication, and blank-line removal all run inside your browser. Nothing you paste leaves your device, so you can safely use it with customer lists or other private data.
Related tools
- Character CounterCount characters, lines, manuscript pages and bytes as you type. Your text never leaves your browser.
- Image to Text (OCR)Extract text from photos, screenshots and scanned images. Works with Japanese and English. Your image is processed in your browser and never uploaded.
- Handwriting to TextRead the text in photos of handwritten memos and notes and turn it into editable text. Your image is processed in your browser and never uploaded.
- Fullwidth / Halfwidth ConverterConvert between fullwidth and halfwidth characters. Also supports katakana-hiragana conversion for data cleanup.
- Line Break ConverterConvert between CRLF, LF and CR. Detects the current line endings and unifies mixed ones.
- Text Encoding ConverterConvert the character encoding of text and log files. Supports Shift_JIS, UTF-8 and EUC-JP.
- Line Break RemoverStrip the stray line breaks you get when copying out of a PDF, Word file, or email.
- Vertical Text GeneratorStack text one character per line for social posts, and preview true vertical writing.
- Acrostic Poem GeneratorTurn a name or word into one line per letter and write your own acrostic poem.
- JSON Formatter & ValidatorPretty-print or minify JSON and see syntax errors by line and column. Includes a tree view.
- Text Diff CheckerSee the differences between two texts, highlighted by line and character. Accept either side for each change.
- Japanese Era ConverterConvert between Western years and Japanese eras (Reiwa, Heisei, Showa, Taisho, Meiji), with an age reference table.
- Password GeneratorGenerate strong, random passwords instantly. Customize length, character types, and check strength.
- CSV Encoding ConverterChange a CSV file's character encoding to UTF-8, Shift_JIS and more. Fixes garbled text when Excel opens the file.
- Compare CSV FilesCompare two CSV files and pull out the differences. Match rows on a key column and see added rows, removed rows and changed cells colour-coded.
- Typing Speed TestType short English sentences for 30 or 60 seconds and get your WPM, accuracy and number of mistakes. Each letter turns green or red as you type. Free, no sign-up.