Case Converter

Paste text and pick a case. The first four are for prose: upper, lower, title and sentence case. The rest are for code, and turn a phrase or an existing identifier into camelCase, snake_case, kebab-case and their relatives. There is also a mode built for API work: paste a JSON response and every key is renamed, at every depth, while the values are left alone.

Automatic treats each line as a separate name when you choose a code case and the input has several lines; otherwise it converts the text as a whole. Everything runs in your browser — nothing is uploaded.

Nothing converted yet.
Type or paste text above and choose a case.

The cases, with examples

CaseExampleWhere you meet it
UPPERCASEORDER TOTAL AMOUNTHeadings, warnings, SQL keywords
lowercaseorder total amountEmail addresses, host names, normalising input before comparing
Title CaseOrder Total AmountHeadlines, page titles, button labels
Sentence caseOrder total amountBody text, interface copy
camelCaseorderTotalAmountJavaScript and Java variables; JSON keys in many APIs
PascalCaseOrderTotalAmountClass and type names; C# properties
snake_caseorder_total_amountPython and Ruby; database columns; JSON keys in many other APIs
CONSTANT_CASEORDER_TOTAL_AMOUNTConstants and environment variables
kebab-caseorder-total-amountURL paths, CSS classes, command-line flags
Train-CaseOrder-Total-AmountHTTP header names such as Content-Type
dot.caseorder.total.amountConfiguration keys, event names such as invoice.paid

The last row is why webhook event types look the way they do, and the one above it is why HTTP headers do. Header names are in fact case-insensitive, and HTTP/2 sends them all in lower case; Train-Case is a convention for people, covered in the HTTP headers guide.

Renaming JSON keys between conventions

The commonest reason a developer needs this tool is a mismatch at an API boundary. The back end is Python or Ruby and speaks snake_case; the front end is JavaScript and wants camelCase; a third-party API uses whichever you are not. Set Apply to to JSON keys, paste a response body, and choose the target case:

{ "user_id": 4021, "billing_address": { "postal_code": "EC1A 1BB" } }

→ camelCase

{ "userId": 4021, "billingAddress": { "postalCode": "EC1A 1BB" } }

Keys are renamed at every level, inside nested objects and arrays. Values are never touched, so a string that happens to contain underscores stays exactly as it was. That is the difference from running a find-and-replace over the text, which cannot tell a key from a value.

Two things to watch for

Collisions. Two keys that differ only in style, such as user_id and userId in the same object, become the same key after conversion and one value overwrites the other. The tool counts keys before and after and warns when any were lost.

The round trip is not always exact. userID becomes user_id in snake_case, and converting that back gives userId, not the original. Acronyms and digits are where conventions disagree, so decide on one spelling and apply it everywhere. For a quick check of what changed, paste both versions into JSON compare.

This is useful for building a test fixture or reading an unfamiliar response. In an application, do the conversion in one place — a serializer setting or a small function at the edge of your HTTP client — and not by hand. The JSON formatter and JSON viewer help with the same payloads.

How words are found

Converting to a code case means first deciding where one word ends and the next begins. The tool splits on anything that is not a letter or a digit, and also inside existing identifiers:

InputWords foundsnake_case
order total amountorder, total, amountorder_total_amount
orderTotalAmountorder, Total, Amountorder_total_amount
Order-Total-AmountOrder, Total, Amountorder_total_amount
HTTPServerErrorHTTP, Server, Errorhttp_server_error
userIDuser, IDuser_id
version2Betaversion2, Betaversion2_beta

A run of capitals followed by a capitalised word is treated as an acronym and kept together, which is how HTTPServerError comes out right. A digit stays attached to the word before it. Apostrophes are dropped, so don't stop becomes dontStop. Letters outside the English alphabet are handled as letters, not as separators.

Lists

Paste one name per line and choose a code case, and each line is converted on its own, giving you a column of converted names in the same order. That is the fast way to turn a list of database columns into property names, or spreadsheet headings into keys. Force the behaviour either way with the Apply to selector.

Title case and sentence case have judgement in them

Title Case here capitalises every word except short articles, conjunctions and prepositions — a, an, the, and, but, or, for, nor, as, at, by, in, of, on, per, to, up, via, vs — unless one of them comes first or last. Words that already contain a deliberate capital, such as iPhone, API or McDonald, are left as you typed them. Style guides differ on the details, particularly on longer prepositions, so treat the result as a first pass for a headline, not as the final word.

Sentence case lowers everything and then capitalises the first letter after a full stop, question mark, exclamation mark or line break, and the pronoun “I”. It cannot know which words are names, so london and ada will need putting back by hand.

Upper and lower case follow Unicode rules, which occasionally surprise: the German ß becomes SS in upper case and does not come back. If you are lower-casing identifiers to compare them, such as email addresses, that is the behaviour you want; if you are trying to preserve text exactly, it is not.

Frequently asked questions

How do I convert text to camelCase?

Paste the text or an existing identifier above and press camelCase. The words are joined with no separator, the first in lower case and each later one capitalised, so “order total amount” and “order_total_amount” both become orderTotalAmount.

What is the difference between camelCase and PascalCase?

Only the first letter. camelCase starts with a lower-case letter, as in orderTotal, and PascalCase starts with a capital, as in OrderTotal. PascalCase is sometimes called upper camel case.

What is the difference between snake_case and kebab-case?

The separator. snake_case joins lower-case words with underscores and is valid as a variable name in most languages. kebab-case joins them with hyphens, which most languages read as a minus sign, so it is used in URLs, CSS class names and command-line flags instead.

How do I convert JSON keys from snake_case to camelCase?

Set Apply to to JSON keys, paste the JSON, and press camelCase. Every key at every depth is renamed and the values are left unchanged. The same works in the other direction and for any of the code cases.

Which case should JSON keys use?

There is no rule in the JSON specification. camelCase is common in APIs written for JavaScript clients and snake_case in APIs from Python and Ruby back ends. What matters is using one convention consistently across an API.

Which words stay lower case in title case?

Short articles, conjunctions and prepositions such as a, an, the, and, but, or, of, in, on, to and for, unless they are the first or last word. Style guides disagree on the exact list, so check the result against the guide you follow.

Is my text uploaded?

No. The conversion runs in JavaScript on this page and no network request is made with your text.

Related tools and reference