Text Formatter
Case conversion, sorting, deduplication, remove empty lines, add line numbers, full-width/half-width conversion, and more.
Related guide
How to Clean Up and Count Text, and Why the Two Counters Disagree
The fifteen formatter actions each redraw your text under different rules — sorting, deduplication and width conversion all have surprises — and the site's two word counts deliberately measure different things.
How the actions work
Everything on this page follows the same two-box model: text goes into the input box, an action reads it and writes the result into the output box, and nothing touches your input. That means a transformation is never destructive — you can run case conversion, look at the result, and still have the original to work from.
It also means the actions do not chain on their own. To feed one result into the next, press Result → Input, which moves the output back to the top and clears the box so you can see the next change on its own. This is the normal way to do something like de-duplicating and then sorting: two clicks, no intermediate copy-and-paste.
Case, spacing and line cleanup
The case actions cover the three usual forms. Title Case capitalises the first letter of each whitespace-separated word and lowercases the rest, which is what you want for headings and names; note that it treats a hyphenated compound as one word, so only the first part is capitalised. Merge Spaces collapses runs of spaces and tabs to a single space and removes trailing whitespace at the ends of lines, without otherwise changing the line structure — handy for text copied out of a PDF or a web page, where the spacing is rarely clean.
Trim Lines removes whitespace from the start and end of every line while keeping the lines and blank lines exactly as they are; Remove Empty Lines goes further and drops the blank lines entirely, including lines that hold only spaces. Removing empty lines first usually makes the next step more predictable.
Sorting, duplicates and numbering
Sort Ascending and Sort Descending order the lines using locale-aware comparison, with two behaviours worth knowing. Numbers inside the text are compared as numbers rather than character by character, so file2 comes before file10 instead of after it. And comparison ignores case and accents, so Apple, apple and ápple are treated as equal and keep their original relative order.
Remove Duplicates works on exact whole-line matches — it does not ignore case or leading spaces, so normalising the spacing first gives better results. Add Line Numbers prefixes every line with its index, and Remove Line Numbers strips a leading number followed by a full stop, a closing bracket or the Chinese enumeration comma, which covers the numbering styles you get out of most editors.
The two reversal actions are different in kind. Reverse Lines flips the order of the lines while leaving each line readable. Reverse Text flips the characters within the text, which is the one people use for puzzles and for spotting right-to-left rendering bugs.
Full-width and half-width conversion
Full-width characters are the wide forms used in CJK typography: full-width digits and Latin letters occupy the same square as a Chinese character, which is what keeps mixed Chinese and Latin text aligned in columns. The two actions convert between those forms and their ordinary narrow equivalents, over the full range of printable ASCII, and both handle the ideographic space correctly — converting it to a normal space in one direction and back in the other.
Use Full-width to Half-width when text typed on a Chinese keyboard leaves wide digits in code, a data file or a URL. Use the reverse when you are preparing copy that has to align in a CJK layout. Japanese half-width katakana is outside the range handled here and is left untouched, so a file mixing Japanese and Chinese full-width text needs attention in the other direction only.
FAQ
Why did my second action ignore the first one?
Each action reads the input box, not the output box. Press Result → Input first to move the previous result up, then run the next action. Chaining is manual by design, so you can see what each step did.
Does Remove Duplicates ignore case or extra spaces?
No — it matches whole lines exactly. "Apple" and "apple", or " apple" and "apple", are treated as different lines. Run Trim Lines and lower-case first if you want a case- and spacing-insensitive comparison.
How is the sorting done?
With locale-aware comparison rather than raw character codes, so it behaves like a dictionary sort rather than a code-point sort. Numbers embedded in the text are compared numerically, meaning item2 sorts before item10, and case and accents are ignored so equal lines keep their original order.
What does Reverse Text do to emoji and accented letters?
Characters are reversed as whole code points rather than as raw bytes, so ordinary accented letters and single-character emoji survive intact. Sequences built from several code points — flags, family emoji, some South Asian scripts — will come out scrambled, since reversing cannot keep the parts together.
Can it handle Chinese text?
Yes. The line-level actions — sorting, de-duplicating, numbering, removing empty lines — work on any text. Remove Line Numbers also recognises the Chinese enumeration comma after a number, and the full-width and half-width actions are built for mixing Chinese and Latin characters on the same line.
Is my text uploaded anywhere?
No. Every action runs in the page, and the text never leaves your browser. That also means there is no history: reloading the page clears both boxes, so copy anything you want to keep before navigating away.