Sort text lines in the order you need

Paste one item per line, choose alphabetic, numeric, length or reverse order, then review the sorted list before copying or downloading TXT.

Paste a list and choose an order

Processed in your browser · saves drafts when allowed Ready
Sorted list

Sort a line-by-line list in three steps

01

Paste a list

Type or paste one item per line. The tool sorts whole lines; it does not read table columns or open files.

Choose the order that fits your list

Your listChoose OrderCheck the result
Names or codes with lettersA → Z or Z → AReview similar names; there is no separate option to distinguish case or accents.
One number per lineNumeric ascendingNegative and decimal numbers with a dot or comma sort by value; nonnumeric lines come after numbers.
Shortest or longest lines firstLength ascending or descendingLength uses the whole line after Trim each line is applied; it is not a word count.
Only reverse the original orderReverse linesThe last line comes first; line text stays unchanged if trimming is off.

If the order is unexpected

Numbers mixed with text
Numeric ascending reads whole integers or decimals; a dot or comma is treated as a decimal mark, not a thousands separator. Lines with units or letters follow the numbers. For codes such as A2/A10, try A → Z and review.
Missing lines or spaces
Remove empty lines also drops whitespace-only lines. Trim each line removes spaces at both ends; turn off the relevant option if you need to keep them, then sort again.
Repeated lines remain
Sorting only changes line positions. To remove repeated lines, use Remove Duplicate Lines under Related Tools.

Drafts on this device when available

The list is sorted in your browser. When local storage is available, your text and options are kept for next time. Select Clear to remove this tool’s input, result and draft; downloaded TXT files stay where you saved them.

Comments & feedback

Rate this tool

Loading ratings…

Write a commentNo account needed

Do not share passwords, sensitive information or the contents of files you are processing.

Reviewed before posting. Email stays private.

Embed this tool on your websiteFree · Copy once, receive tool updates automatically

Paste the iframe into HTML, WordPress or any platform that supports embeds. The tool runs in the visitor’s browser; adjust its height and theme as needed.

View the embed guide and supported platforms →

<div style="max-width:900px">
  <iframe data-kitotool-embed src="https://kitotool.com/embed/en/text-line-sorter/" title="Text Line Sorter — KitoTool" width="100%" height="920" style="display:block;width:100%;border:1px solid #dbe3ee;border-radius:12px" loading="lazy" referrerpolicy="strict-origin-when-cross-origin"></iframe>
  <p style="margin:6px 2px 0;text-align:right;font:12px/1.5 system-ui,sans-serif;color:#64748b">Free tool by <a href="https://kitotool.com/en/text-line-sorter/" target="_blank" rel="nofollow noopener noreferrer" style="color:#2359d4;text-decoration:underline">KitoTool</a></p>
</div>

The code includes a visible credit below the iframe; its link uses nofollow for a widely distributed widget.

Optional: automatically resize the iframe

Add this script once to the page containing the iframe.

<script>
(function(){var origin="https://kitotool.com";function frames(){return document.querySelectorAll("iframe[data-kitotool-embed]")}function measure(f){if(f.contentWindow&&new URL(f.src).origin===origin)f.contentWindow.postMessage({type:"kitotool:measure"},origin)}window.addEventListener("message",function(e){if(e.origin!==origin||!e.data||e.data.type!=="kitotool:resize"||!Number.isFinite(e.data.height))return;frames().forEach(function(f){if(f.contentWindow===e.source&&new URL(f.src).origin===origin)f.style.height=Math.max(320,Math.min(12000,Math.ceil(e.data.height)))+"px";});});function connect(){frames().forEach(function(f){f.addEventListener("load",function(){measure(f)});measure(f)})}if(document.readyState==="loading")document.addEventListener("DOMContentLoaded",connect,{once:true});else connect()})();
</script>