Case Converter

Convert text to camelCase, snake_case, kebab-case, and more

camelCase
Type text above and every case will update instantly.
PascalCase
Type text above and every case will update instantly.
snake_case
Type text above and every case will update instantly.
kebab-case
Type text above and every case will update instantly.
CONSTANT_CASE
Type text above and every case will update instantly.
Title Case
Type text above and every case will update instantly.
Sentence case
Type text above and every case will update instantly.
lower case
Type text above and every case will update instantly.
UPPER CASE
Type text above and every case will update instantly.

About Case Converter

The converter first splits your input into words, then reassembles those words nine ways. Splitting follows three rules. A lowercase letter or digit followed by an uppercase letter is a boundary (fooBar → foo Bar). A run of capitals followed by a capital-plus-lowercase pair is split before that pair (XMLHttp → XML Http). And anything that is not a letter or digit, such as spaces, underscores, hyphens or dots, is a separator. When an output looks wrong, the cause is almost always that the words were split somewhere you didn't expect.

Which output is “correct” depends on the language and the team. The same phrase, “XML HTTP request”, becomes a different identifier under the official style guides for Python, Java, Go and C#.

What the official style guides actually say

In identifier styles (camelCase, PascalCase) this tool follows the Java rule and capitalizes only the first letter of every word, acronyms included. PascalCase output for XMLHttpRequest is therefore XmlHttpRequest. If your codebase follows PEP 8 or Go conventions, restore the acronym capitals by hand after converting. In prose styles (Title Case, Sentence case) a word of two or more capitals, such as XML, JSON or MP3, is treated as an acronym and kept as is. The exception is input that is entirely uppercase (HELLO WORLD, MAX_RETRY), where acronyms can't be told apart, so every word is recased.

  • Python (PEP 8): functions and variables in snake_case, classes in CapWords (PascalCase), constants in UPPER_CASE, modules in short lowercase names. For acronyms in CapWords it says to capitalize all their letters: HTTPServerError is better than HttpServerError.
  • Java (Google Java Style Guide): treat an acronym as an ordinary word and capitalize only its first letter. XmlHttpRequest, not XMLHTTPRequest; newCustomerId, not newCustomerID; supportsIpv6OnIos, not supportsIPv6OnIOS.
  • Go (Code Review Comments): initialisms keep a consistent case, so URL or url, never Url; ServeHTTP rather than ServeHttp; appID rather than appId. Go also uses MixedCaps for constants: an unexported constant is maxLength, not MAX_LENGTH.
  • C# / .NET (Framework Design Guidelines): PascalCase for public members and types, camelCase for parameters, no underscores. Two-letter acronyms are fully capitalized (IOStream), longer ones get only an initial capital (HtmlTag). Id and Ok are treated as words, not acronyms.
  • URLs, CSS classes, file names: kebab-case is the norm. Google's URL guidance recommends hyphens rather than underscores between words.

When the split surprises you

Well-known names that start lowercase and continue in capitals, such as iPhone, iPad, iOS, macOS and eBay, are on a built-in list and stay one word: snake_case gives iphone, camelCase iPhoneCase and Title Case iPhone Case. Names not on the list, like aValue, still split by the rules into a and Value. A digit followed by a capital is also a boundary, while a digit followed by lowercase is not. user_id2FA therefore splits into user, id2 and FA, and camelCase returns userId2Fa. The easiest fix is to give the tool explicit boundaries by typing spaces: “user id 2FA”.

Leading digits survive untouched. 2024Report becomes 2024_report or 2024Report, which is fine for a file name but not a valid identifier in most languages, since identifiers can't start with a digit.

Scripts without case, such as Korean or Japanese, are split only on spaces and punctuation, so they pass through each style with just the separators changed.

Turkish dotted I and German ß

Case mapping depends on language. Turkish has a dotted pair (i, İ) and a dotless pair (ı, I), so under Turkish rules the lowercase of I is ı and the uppercase of i is İ. JavaScript's locale-independent toLowerCase follows Unicode's default mapping and turns İstanbul into i̇stanbul: a plain i followed by a combining dot above (U+0307), an invisible extra character inside an identifier. Since this page's languages (English, Korean, Japanese, Spanish) are not Turkish, the tool lowercases İ to a plain i instead, giving istanbul. It does not apply the Turkish rule that I lowercases to ı, so DİYARBAKIR becomes diyarbakir, and uppercasing ı gives a plain I. If you convert Turkish text, check the result, or use toLocaleLowerCase(“tr”) in your own code.

German ß uppercases to the two letters SS, so straße becomes STRASSE in CONSTANT_CASE. Lowercasing STRASSE gives strasse, not straße. In other words, case conversion is not always reversible, which matters if you ever use a case-folded string as a key.

Worked examples

An identifier with an acronym

Input
getHTTPResponseCode
Output
camel: getHttpResponseCode · snake: get_http_response_code · CONSTANT: GET_HTTP_RESPONSE_CODE

HTTP is detected as one word by rule 2, then written Java-style as Http. In Go you would keep getHTTPResponseCode as it was.

XMLHttpRequest across all styles

Input
XMLHttpRequest
Output
camel: xmlHttpRequest · Pascal: XmlHttpRequest · kebab: xml-http-request · Title: XML Http Request

The PascalCase result matches Google's Java guide exactly. PEP 8 would prefer XMLHTTPRequest for a class name. Title Case keeps XML because it is an acronym.

Title Case keeps acronyms

Input
naïve JSON
Output
Title: Naïve JSON · Pascal: NaïveJson · snake: naïve_json

Title Case recognizes JSON as an acronym and keeps its capitals, while PascalCase follows the Java rule and writes Json. Diacritics are kept; if you need ASCII-only identifiers, remove them separately.

Uppercasing ß

Input
straße größe
Output
CONSTANT: STRASSE_GRÖSSE · camel: straßeGröße

Only the uppercase outputs change ß into SS.

How to use it

  1. Type or paste an identifier or a sentence.
  2. All nine styles appear at once; copy the one you need.
  3. If the name contains acronyms, adjust their capitals to your language's convention.

Frequently asked questions

What is the difference between camelCase and PascalCase?

Only the first letter. userName is camelCase and UserName is PascalCase. Most languages reserve PascalCase for classes and types.

Should JSON keys be snake_case or camelCase?

The JSON spec does not say. APIs consumed directly by JavaScript tend to use camelCase, while Python and Ruby back ends often use snake_case. Consistency within one API matters more than the choice.

Why is XMLHttpRequest converted to xmlHttpRequest?

A run of capitals followed by a capital-plus-lowercase pair marks a new word, so the input splits into XML, Http and Request. camelCase then lowercases the whole first word.

How are constants usually named?

CONSTANT_CASE, meaning uppercase with underscores, in C, Java, Python and JavaScript. Go is the notable exception and uses MixedCaps.

Is kebab-case valid in code?

Not as an identifier in most languages, because the hyphen is the minus operator. It is standard in URLs, CSS class names, HTML attributes and many CLI flags.

Sources

Last reviewed:

Privacy and how data is handled