Case Converter

Convert text and code identifiers between camelCase, PascalCase, snake_case, kebab-case, Title Case and more. Word boundaries such as underscores, hyphens and acronyms are detected correctly.

Target case

Code identifiers

Text

Output: camelCase

Converted text will appear here…

What the case converter is for

Code and data move between systems that disagree on naming. A PostgreSQL table hascreated_at, the JSON your frontend expects hascreatedAt, the environment variable isCREATED_AT and the CSS class iscreated-at. Renaming these by hand is slow and easy to get wrong, especially when acronyms are involved.

This tool rewrites text or identifiers into 14 conventions. The important part is the tokenizer: before joining words with a new separator, it works out where each word starts and ends, whether the input uses spaces, underscores, hyphens, dots, slashes or capital letters. It also writes headings in Title Case or Sentence case for documents and UI copy.

How to use it

  1. Paste text into Input, or press Load example.
  2. Pick a target in Code identifiers (camelCase, snake_case…) or Text (Title Case, UPPER CASE…).
  3. Leave Convert each line separately ticked when the input is a list of names; untick it to treat the whole input as one phrase.
  4. Check the Output panel, then press Copy or Download.
  5. Use the All cases at a glance table to compare every format and press Use to switch to one.

Worked example

The example input contains four lines in four different styles:

XMLHttpRequest
user_id
get-HTTP-response-code
the lord of the rings: the return of the king

With snake_case and per-line conversion the output is:

xml_http_request
user_id
get_http_response_code
the_lord_of_the_rings_the_return_of_the_king

With camelCase the first three lines become xmlHttpRequest,userId and getHttpResponseCode, and Title Case turns the last line into "The Lord of the Rings: The Return of the King": "of" and "the" stay lowercase, but "The" after the colon is capitalised.

The cases and where they are used

  • camelCase: variables and functions in JavaScript, TypeScript, Java and Swift; JSON keys in many APIs.
  • PascalCase: classes, types and React components.
  • snake_case: Python and Ruby names, SQL columns. SCREAMING_SNAKE: constants and environment variables.
  • kebab-case: CSS classes, HTML attributes, file names and URLs. Train-Case: HTTP header names such as Content-Type.
  • dot.case and path/case: configuration keys (app.db.host) and folder paths.
  • Title Case and Sentence case: headings, buttons and UI labels. Sentence case lowercases everything and capitalises the first letter after . ! ? and at the start of each line.
  • aLtErNaTiNg alternates only letters, and iNVERT cASE swaps upper and lower case.

Limitations

Identifier cases drop punctuation, so user.id? and user idproduce the same result. Digits stay attached to the preceding word (version2Updatebecomes version2_update), and a lowercase prefix like the "i" in iPhone is treated as its own word in identifier cases. Sentence case cannot know which words are proper nouns, so names like "London" are lowercased and need a manual fix. Inputs above 500,000 characters are rejected to keep the page responsive.

Tips

  • Copy a column header row from a spreadsheet, replace tabs with line breaks, and convert all names in one go.
  • For URLs, the slug generator also removes accents and stop words.
  • Checking a renamed file for missed spots? Paste old and new versions into the text diff tool.

Frequently Asked Questions

How does the converter find word boundaries in identifiers?

It splits on spaces, underscores, hyphens, dots, slashes and other punctuation, and also where a lowercase letter or digit is followed by an uppercase one. Runs of capitals are treated as acronyms, so XMLHttpRequest becomes xml, http, request.

What is the difference between snake_case, kebab-case and camelCase?

snake_case joins lowercase words with underscores (user_id), kebab-case uses hyphens (user-id) and camelCase removes separators and capitalises every word after the first (userId). PascalCase also capitalises the first word (UserId).

Which words stay lowercase in Title Case?

Articles, short conjunctions and short prepositions such as a, an, the, and, or, of, in, on, to and via stay lowercase unless they are the first word, the last word or follow a colon. Words that already contain capitals in mixed-case text, like NASA or iPhone, are left as typed.

Can I convert a whole list of variable names at once?

Yes. Paste one identifier per line and keep “Convert each line separately” ticked. Each line is converted on its own, so a list of column names stays a list instead of becoming one long identifier.

Does it work with accented or non-Latin letters?

Yes. Tokenizing and case mapping are Unicode-aware, so café_crème becomes caféCrème in camelCase. If you need ASCII-only output for URLs, use the slug generator, which removes accents.

Is my text uploaded anywhere?

No. Conversion runs in JavaScript in your browser. Nothing is sent to a server or stored.