Text Formatter
text / formatter Text Formatter
Clean up and standardize text: convert between sentence case, UPPER CASE, lower case, Title Case, and InVeRsE cAsE, switch identifiers between camelCase, PascalCase, snake_case, kebab-case and CONSTANT_CASE, and strip the stray whitespace that comes with copying from a PDF or a formatted document. A live count of words, characters, sentences, paragraphs, lines and estimated reading time updates as you type, and the result can be copied or downloaded as a text file. Everything runs in your browser, so confidential text stays on your device.
Configuration options
Case conversions and the programmer naming conventions, applied to whatever you paste.
| Convention | Example | Conventional in |
|---|---|---|
| camelCase | userAccountId | JavaScript, Java variables |
| PascalCase | UserAccountId | Type and class names |
| snake_case | user_account_id | Python, Ruby, SQL columns |
| kebab-case | user-account-id | CSS, URLs, HTML attributes |
| CONSTANT_CASE | USER_ACCOUNT_ID | Constants, environment variables |
The case styles explained
Five prose transformations, each solving a different problem:
Sentence case
Capitalizes the first letter of each sentence and lowercases the rest. This is the fix for text that arrived in ALL CAPS — pasted from a legacy system, a spreadsheet export, or a form where someone left caps lock on.
UPPER CASE
Every letter capitalized. Useful for constants, headings, and short labels. Avoid it for long passages: uppercase text removes the distinctive ascenders and descenders that make word shapes recognizable, so it reads measurably slower.
lower case
Everything lowercased. The usual first step when normalizing data for comparison, since "Smith" and "SMITH" are different strings to a computer but the same name to a person.
Title case
Capitalizes the start of each word. Standard for headings, article titles, and product names. Note that this capitalizes every word, whereas strict editorial style guides leave short articles and prepositions lowercase — so check headlines by eye afterward.
InVeRsE cAsE
Flips the case of every letter. Genuinely useful in one situation: text typed with caps lock on and shift held, which arrives as the exact inverse of what was intended. One pass restores it.
Programmer case styles
The five identifier conventions below convert between each other, not just from plain prose. The splitter understands existing boundaries — camelCase humps, underscores, hyphens and consecutive capitals — so getHTTPResponseCode becomes get_http_response_code rather than one undifferentiated run. That makes renaming a variable across languages a paste rather than a retype.
- camelCase— first word lowercase, the rest capitalized. Variables and functions in JavaScript, Java and Swift.
- PascalCase— every word capitalized. Class and type names in most languages, and React components.
- snake_case— lowercase words joined by underscores. Python, Ruby and SQL column names.
- kebab-case— lowercase words joined by hyphens. CSS classes, URL slugs and HTML attributes.
- CONSTANT_CASE— uppercase words joined by underscores. Constants and environment variables.
Counting words and characters
Character counts here are of Unicode code points, not bytes. For plain ASCII the two agree; for anything else they do not, and a field limit expressed in bytes will reject text this tool reports as short enough.
The statistics above the input update as you type: words, characters with and without spaces, sentences, paragraphs, lines, and an estimated reading time. The two character counts matter in different places — social platforms and database columns usually count every character including spaces, while style guidance about line length usually does not. Reading time assumes 200 words per minute, a common average for silent reading of ordinary prose; technical material runs slower.
Removing whitespace
Whitespace problems are invisible, which is what makes them irritating. Text copied out of a PDF, a web page, or an email quotation routinely carries trailing spaces at the end of lines, doubled spaces between sentences, and indentation that made sense in the source and none in the destination.
Those extra characters are real. They break exact-match comparisons, defeat lookups on a supposedly identical key, throw off character counts against a field limit, and produce ragged alignment when the text is displayed somewhere else. Collapsing runs of whitespace and trimming the ends removes an entire category of "but it looks the same" bugs.
Common uses
- Cleaning pasted text— strip the stray spacing that comes with copying from a PDF or a formatted document.
- Fixing accidental caps lock— recover a paragraph typed entirely in capitals without retyping it.
- Normalizing data before import— make values consistent so duplicates actually match.
- Preparing headings— apply title case across a batch of headings so they agree with each other.
- Tidying transcripts and notes— dictated and auto-transcribed text often needs sentence case restored.
- Cleaning CSV fields— leading and trailing spaces in a column are a classic cause of failed joins.
Tips
- Keep a copy of the original before transforming a long document. Case conversion is not reversible: once a proper noun has been lowercased, nothing knows it was a name.
- Sentence case relies on punctuation to find sentence boundaries. Text without full stops will be treated as one long sentence.
- Check acronyms after converting. Title case and sentence case will render NASA as Nasa, which is rarely what you want.
- Combine operations in one pass — apply a case style and remove whitespace together rather than running the text through twice.