Sorting text in Excel means putting a column of cell values into a deliberate order, most commonly alphabetical A to Z or reverse Z to A, but it can also mean natural numeric order (file2 before file10) or a custom sequence you define. Excel's built-in Sort dialog on the Data tab handles single columns and multi-column ranges, supports header detection, and lets you choose ascending or descending direction plus case sensitivity. The practical limit is that Excel sorts inside the workbook, so any cleanup of pasted-in text — stray spaces, blank rows, duplicates, mixed line endings — has to happen either with formulas or with a separate tool. For line-oriented text you have already copied out of a sheet (a column of names, a list of filenames, a stack of labels), a dedicated browser sorter like Text Sorter gives you predictable, deterministic ordering before you paste the result back into Excel.

What Excel's Built-In Sort Actually Does
Excel sorts a selected range or table by one or more columns, using the Sort dialog launched from Data > Sort & Filter > Sort. The dialog offers Sort by, Sort On (cell values, cell color, font color, conditional formatting icon), and Order (A to Z, Z to A, Smallest to Largest, Largest to Smallest, or a custom list). When Excel detects a header row, it sorts by column name instead of by the literal header cell. Direction is per column, so you can sort department A to Z and salary Largest to Smallest in the same pass.
For text columns, Excel uses locale-aware comparison tied to the workbook's regional settings. That means Excel installed in Germany with a German locale may order ß and ä differently than Excel installed in English-speaking regions. Case sensitivity is an explicit checkbox in the Options dialog. Without that checkbox, Excel treats Apple and apple as equal for ordering purposes.
Excel's sort is in-place: it rearranges rows within the selection. If you sort a column without selecting all related columns, Excel warns that surrounding data will be left out and offers to expand the selection. Accepting the warning is usually correct; declining can split a row in two.
When to Move Text Out of Excel and Sort Locally
There are four situations where copying a column out of Excel, sorting it elsewhere, and pasting it back is faster or more reliable than fighting with the worksheet:
- You have a single column of values with no formulas — names, filenames, tags, product labels — and you want a one-shot A to Z or numeric sort without disturbing the rest of the sheet.
- The text was pasted in from another source, and carries invisible spaces, blank rows, or duplicate entries you want removed at the same time as sorting.
- You want natural numeric order (file2 before file10) without writing a helper column with VALUE() and LEFT() formulas.
- You need deterministic, reproducible ordering that you can re-run against the same input and get the same output every time — useful for diff-friendly lists and audit trails.
For each of these, a browser tool that runs locally and never uploads the source is the right choice. Sorting a single column of pasted text is what Text Sorter is built for.
Sort Text With Text Sorter: Step by Step
The three documented operating steps for Text Sorter map directly to the Excel workflow where you copy out, clean up, and copy back.
- Paste the line-oriented text to sort. In Excel, select the column you want to sort, copy it (Ctrl+C), and paste it into the input area. Text Sorter accepts up to 1,000,000 UTF-16 code units and up to 50,000 logical lines. Inputs over those limits are rejected before sorting begins, with no partial output.
- Choose direction, case, and numeric comparison, then enable only the cleanup controls you want. Pick ascending or descending order, decide whether comparison is case-sensitive, and switch Natural number order on if digit runs should sort numerically. Independently toggle Trim every line, Remove empty lines, and Remove exact duplicates. Each toggle changes behavior on its own; leaving all three off gives you a pure line reorder.
- Sort the lines, verify the before-and-after counts and exact preview, then download the TXT result. Run the sort, compare the original logical line count against the final line count (a difference means empty-line or duplicate removal, never sort reordering), copy the preview, or download the result as a UTF-8 TXT file. Changing any input or option clears the old output immediately so a stale count cannot be confused with the new configuration.
When the file is downloaded, paste the result back into Excel with Ctrl+V. Because the output uses LF line endings, Excel on Windows will display it as a single cell with embedded line breaks; to put each value on its own row, use Paste Special > Text and let Excel's Text Import Wizard split on the LF, or paste into a single column with Alt+Enter between values.
Direction, Case, and Numeric Options Compared
| Control | What it changes | When to use it |
|---|---|---|
| Ascending | Lower to higher order under the collator | Default; use for A to Z or smallest to largest |
| Descending | Reverses comparison, keeps stable ties | Reverse-sorted lists where equivalent entries must stay in their original order |
| Case-sensitive | Case participates in collation | When Apple and apple should not compare as equal |
| Natural number order | Digit runs compare numerically | Filenames, version labels, invoice numbers |
These four options compose: with Natural number order on and case sensitivity off, file2 still beats file10 because natural order is applied independently of case folding. The browser's English Intl.Collator is documented by MDN as the underlying comparator, and the sort algorithm follows the standard Array.sort contract, with original index as the stable tie breaker.
Cleanup Controls: Trim, Empty Lines, Exact Duplicates
| Cleanup option | Order of execution | What it removes or keeps |
|---|---|---|
| Trim every line | First | Leading and trailing Unicode whitespace; does not collapse internal spaces |
| Remove empty lines | After optional trimming | Lines that are empty post-trim; without trimming, a line containing only spaces is not empty |
| Remove exact duplicates | After trim and empty-line removal, before sorting | JavaScript-string-equal duplicates only; keeps the first occurrence |
Exact means JavaScript string equality. With case-insensitive comparison turned on, Apple and apple still compare as equal for ordering, but Remove exact duplicates does not collapse them into one entry — only literal character-by-character matches are removed. No fuzzy matching or Unicode normalization is applied, so café and cafe stay separate. The first occurrence is kept; later exact copies are dropped, and the surviving line's character content is unchanged unless trimming is also enabled.
Line Endings, Stability, and Limits
Text Sorter recognizes CRLF, standalone CR, and LF as line boundaries and emits LF between sorted lines. Mixed endings in the input become consistent in the result, which matters when you are about to paste into Excel on Windows where CRLF is the native cell line break — opening the downloaded TXT in Excel will honor the LF boundaries as row breaks during Text Import, but a direct paste keeps them inside one cell. Sorting is stable, so equivalent lines remain in their original relative order whether the direction is ascending or descending. Descending reverses the comparison result, not the final array, so ties do not flip.
The hard limits bound every part of the pipeline: splitting, decorated stable sorting, preview rendering, and Blob creation. Exactly 1,000,000 UTF-16 code units and 50,000 lines are accepted; over-limit input is rejected before any sorting starts. Malformed UTF-16 surrogate sequences are also rejected at validation. Nothing is uploaded; cleanup, sorting, previewing, and download creation all happen locally, and the temporary Blob URL used for the download is revoked immediately after the browser starts the file transfer.
When Text Sorter Is Not the Right Tool
Text Sorter is not a CSV-aware sorter. A CSV row can contain quoted line breaks inside a cell, and sorting on physical line breaks can corrupt record structure. When quoting, headers, or multiple columns matter, use a format-aware table tool instead. Text Sorter also does not parse decimal quantities, dates, versions, units, or signed mathematical expressions as structured data — natural number order only interprets digit runs as numbers. Collation can differ from database ORDER BY, operating-system filename order, or another programming language's sort, so if the sorted output will become a contractual or reproducible machine artifact, confirm that English browser collation and the selected numeric and case options match the destination system.
Quick Reference: From Excel Column to Sorted List
Copy the column in Excel (Ctrl+C). Open Text Sorter and paste. Choose ascending or descending, set case and natural number order to match your goal. Toggle Trim, Remove empty lines, and Remove exact duplicates only if you want them. Run the sort, compare original and final line counts, then copy the preview or download the TXT. Paste back into Excel with Paste Special > Text or route through Text Import Wizard to land each value in its own row. For a related cleanup of pasted lists, the Remove Duplicate Lines page documents the same exact-equality rule used inside Text Sorter.