Case Converter

Convert between text cases.

UPPERCASE
lowercase
Title Case
Sentence case
camelCase
PascalCase
snake_case
kebab-case
CONSTANT_CASE
dot.case

About the Case Converter

Type or paste a string and see it in ten cases at once, each with its own copy button. Word boundaries are detected from camel-case humps, underscores, hyphens, dots and spaces, so an existing identifier can be converted straight into another convention without splitting it by hand. Everything is computed in your browser as you type, with no request made and nothing stored.

How to use the Case Converter

  1. Type or paste your text into the input box, or press Sample to load an example.
  2. Read the ten converted forms below, which update on every keystroke.
  3. Press the copy button beside the form you want.
  4. Press Clear to empty the input.

Frequently asked questions

Which cases does it produce?
Ten: UPPERCASE, lowercase, Title Case, Sentence case, camelCase, PascalCase, snake_case, kebab-case, CONSTANT_CASE and dot.case. hello world example gives helloWorldExample, HelloWorldExample, hello_world_example, hello-world-example, HELLO_WORLD_EXAMPLE and hello.world.example respectively.
Can I convert an identifier that already has a convention?
Yes, that is the common case. Humps, underscores, hyphens and dots are all treated as word boundaries, so my-file_name.txt converts to myFileNameTxt, my_file_name_txt or MY_FILE_NAME_TXT, and userID becomes user_id or userId without any manual splitting.
Why does XMLHttpRequest not convert the way I expect?
A word boundary is only detected where a lowercase letter or digit is followed by an uppercase one, so a run of capitals is read as one word. XMLHttpRequest splits into XMLHttp and Request, giving xmlhttpRequest and xmlhttp_request rather than xml_http_request. Insert a separator before converting when an acronym has to break.
What happens to punctuation?
Only underscores, hyphens and dots are treated as separators. Everything else is carried into the output, so Hello. World! Ok? gives the camelCase helloWorld!Ok? with the exclamation mark and question mark intact, and an apostrophe survives in o'neill_and_co. Strip punctuation first if you are generating a variable name.
How do Title Case and Sentence case differ?
Title Case capitalises the first letter of every word, including short ones, and does not apply any style-guide exceptions. Sentence case capitalises only the first letter and anything following a full stop, question mark or exclamation mark. Both lowercase the rest of the text first, so an acronym in the input does not survive either of them.

Related tools