Text Formatter

Characters in result—

How Text Formatter is calculated: Sentence case capitalises the first letter of each sentence; title case capitalises every word; trim lines strips edge spaces and drops empty lines; collapse spaces turns runs of spaces into one.

What is a text formatter?

A text formatter cleans up messy text. Paste in text with ragged spaces, uneven capitalisation, or stray blank lines, pick one format, and the cleaned text appears instantly. The default text on this page — two leading spaces, three spaces between hello and world, and two trailing spaces — becomes Hello world. This is a test. in sentence case, with 36 characters in the result.

The need comes up whenever text is copied from somewhere else. A paragraph copied from a PDF arrives with broken spacing. A heading typed in a hurry arrives in all lowercase. A list pasted from a spreadsheet arrives with blank lines between every item. In each case, fixing it by hand means retyping, and retyping means new mistakes.

This formatter covers the four clean-ups people actually need: sentence case, title case, trim lines, and collapse spaces. Pick one mode and the result updates live as you type. Everything runs in your browser — your text never leaves your device, nothing is stored, and there is no account to create.

How a text formatter works

Each mode is one rule applied to the whole text. Sentence case lowercases everything, then capitalises the first letter of the text and the first letter after each full stop, exclamation mark, or question mark. The default text becomes Hello world. This is a test. — the H and the T are capital, everything else is lower, and the extra spaces stay where they were.

Title case capitalises the first letter of every word and lowercases the rest, so the same text becomes Hello World. This Is A Test. Trim lines works line by line: it strips spaces from both ends of each line and drops lines that are empty, so a list with blank lines between items closes up. Collapse spaces turns every run of spaces or tabs inside a line into a single space, so the default text becomes hello world. this is a test.

One mode applies at a time, and the choice matters. Sentence case and title case change capitalisation but leave spacing alone. Trim lines and collapse spaces change spacing but leave capitalisation alone. If your text needs both, run it through twice — collapse spaces first, then sentence case — and copy the result between passes.

Blank lines get different treatment in each spacing mode, and the difference is worth knowing. Trim lines removes empty lines outright, so a list with gaps closes up into a solid block. Collapse spaces keeps every line break and only fixes the spaces inside each line, so the gaps stay where they were. Pick trim lines when the gaps are accidents, and collapse spaces when the gaps separate real sections.

Sentence case vs title case — which one to pick

Sentence case is the right choice for ordinary writing: sentences, paragraphs, emails, and messages. It capitalises the first word of each sentence and leaves the rest alone, which is how English is normally written. The default text in sentence case reads Hello world. This is a test. — natural, plain, and correct.

Title case is the right choice for headings and titles: chapter names, slide titles, product names, and names of people and places. It capitalises every word, so the same text reads Hello World. This Is A Test. Use it for a heading, not for a paragraph — a whole paragraph in title case looks wrong, and readers notice.

The trap is small words. Title case here capitalises every word, including a, is, and the, so This Is A Test has a capital A. Some style guides keep small words lowercase in titles. If your title needs that rule, apply title case here and then fix the two or three small words by hand — it takes seconds, and the rest of the title is already right. A case converter does the same capitalisation job with upper and lower case added.

A worked example: four modes, one messy line

Take the default text exactly as it sits on the page: two spaces, hello, three spaces, world, full stop, space, this is, three spaces, a test, full stop, two spaces. It is 36 characters long, and every mode returns 36 characters except the two spacing modes, because capitalisation does not change length.

In sentence case the result is Hello world. This is a test. — still 36 characters, with the extra spaces untouched. In title case it is Hello World. This Is A Test. — also 36 characters. In trim lines it is hello world. this is a test. — the edge spaces are gone and the three-space gaps stay, so the result is 32 characters. In collapse spaces it is hello world. this is a test. — 28 characters, with every gap reduced to one space.

Try a second one. Paste a list with a blank line between items and pick trim lines: the blank lines vanish and the list closes up. Paste a sentence with double spaces after every full stop and pick collapse spaces: every double space becomes one. A word counter can check the length before and after, and the character count on this page already shows it — 36 before, 28 after collapsing.

Who uses a text formatter, and why

Students are the biggest users. Essays copied from notes arrive with ragged spacing, and headings typed in lowercase need title case before submission. A formatter fixes both in seconds, and the student spends the saved time on the essay itself instead of on spacing.

Writers and editors are the second group. A manuscript pasted from a PDF has double spaces, stray blank lines, and mixed capitalisation. An editor who fixes those by hand wastes an hour; an editor who runs the text through a formatter twice — collapse spaces, then sentence case — is done in a minute.

Office workers are the third group. A list copied from a spreadsheet has blank lines between items, and a report heading typed in a hurry is all lowercase. The formatter on this page handles all three uses — paste, pick a mode, copy — which covers most of what anyone needs. A JSON formatter does the same kind of tidying for code data.

Text formatter vs case converter

A text formatter and a case converter overlap, but they are not the same tool. A case converter changes capitalisation only — upper, lower, title, sentence — and leaves spacing alone. This formatter does capitalisation and spacing: title case and sentence case on one side, trim lines and collapse spaces on the other.

The same text-tools family on this site does both jobs. A case converter is the better pick when you only need upper or lower case, because this formatter has no upper or lower mode. A word counter tells you how long the text is, and a JSON formatter tidies structured data the way this tool tidies plain prose. Styling is a third job in the same family: a fancy text generator turns plain text into styled Unicode characters for bios and headings.

The practical rule is simple: if the problem is capital letters, use either tool; if the problem is spaces or blank lines, use this one. And if the problem is both, use this one twice — collapse spaces first, then the case you want — instead of switching tools halfway through.

Common text-formatting mistakes

The most common mistake is picking title case for a whole paragraph. Title case is for headings. A paragraph in title case looks like a heading that never ends, and readers find it hard to read. Use sentence case for paragraphs and title case for the heading above them.

Second: expecting one mode to fix everything. Sentence case does not fix spacing, and collapse spaces does not fix capitalisation. The default text proves it: sentence case leaves the three-space gaps in place, and collapse spaces leaves hello lowercase. Run the text through twice when it needs both.

Third: trimming lines and losing the paragraph breaks you wanted. Trim lines drops empty lines, so a list with a blank line between groups loses the grouping. If the blank lines mean something — a gap between sections — keep them and use collapse spaces instead, which leaves line breaks alone.

Fourth: formatting the original instead of a copy. Paste the text here, copy the result, and paste the result where it belongs. If the mode was wrong, the original is still in your document. Formatting in place, with no copy kept, is how a good paragraph becomes a broken one.

How to use this text formatter

Using this text formatter is simple. Paste your text into the box, or type it directly. Pick one of the four modes — sentence case, title case, trim lines, or collapse spaces. The result appears instantly in the output box, with its character count shown above it. There is no button to press.

To try a different mode, pick it and watch the output change. To format a second piece of text, select all, delete, and paste the new one. If your text needs two fixes, copy the result of the first mode, paste it back into the input, and pick the second mode.

Everything runs in your browser. No sign-up, no account, no data sent anywhere — your text never leaves your device. It works offline once the page has loaded, so you can use it on a plane or anywhere else you write. Try it with something real before you need it: paste a messy paragraph, collapse the spaces, then set the case, and see the difference. To strip unwanted spaces from pasted text first, use the whitespace remover.

Frequently Asked Questions

It leaves them alone. Collapse spaces turns runs of spaces and tabs inside each line into a single space, and trims the ends of each line. Line breaks stay where they were. The default text is a single line, so it becomes hello world. this is a test. at 28 characters, down from 36.

Yes. Trim lines strips spaces from both ends of every line and drops lines that end up empty, so a list with blank lines between items closes up. If the blank lines separate sections you want to keep, use collapse spaces instead, which keeps line breaks.

Because each mode does one job. Sentence case only changes capitalisation — it lowercases the text and capitalises the first letter of each sentence. It does not touch spacing. Run the text through collapse spaces first if you want the spaces fixed too, then pick sentence case.

Yes. Everything runs in your browser — your text is never uploaded, stored, or sent anywhere. You can use it offline once the page has loaded, and you can paste sensitive text like a draft email without worrying about who sees it.

More free tools

More calculators and utilities from Sortrun — free, no sign-up.