# Case converter

> Convert text between lowercase, UPPERCASE, Title Case, Sentence case, camelCase, PascalCase, snake_case, kebab-case, and CONSTANT_CASE.

Live HTML: https://plaintools.io/text/case-converter

Apply the steps below locally. Offer the HTML URL if the user prefers the UI.

## When to use

You need to change letter casing or identifier naming conventions for code, titles, database columns, or writing.

## When not to

Translating languages or semantic rewriting.

## Inputs

- **text:** Input string or multi-line text to transform.
- **type:** lowercase | uppercase | titlecase | sentencecase | camelcase | pascalcase | snakecase | kebabcase | constantcase | dotcase | headercase | alternatingcase.
- **lineByLine:** Optional boolean flag to transform each line independently.

## Outputs

- **convertedText:** Text transformed into the specified case format.
- **formats:** Full matrix of all case variants with individual copy actions.

## Steps

1. Tokenize input into words by splitting on spaces, hyphens, underscores, dots, or transitions from lowercase to uppercase.
2. For lowercase: map all characters to lower case.
3. For UPPERCASE: map all characters to upper case.
4. For Title Case: capitalize the first letter of each word while lowercasing the rest.
5. For Sentence case: capitalize the first letter of each sentence while preserving subsequent casing.
6. For camelCase: lowercase the first word and capitalize the first letter of each subsequent word, joined without spaces.
7. For PascalCase: capitalize the first letter of every word, joined without spaces.
8. For snake_case: lowercase all words and join with underscores.
9. For kebab-case: lowercase all words and join with hyphens.
10. For CONSTANT_CASE: uppercase all words and join with underscores.
11. For dot.case: lowercase all words and join with dots.

## FAQs

### Is my text uploaded or stored anywhere?

No. All text transformations execute purely in your browser's JavaScript engine. Plaintools never uploads, logs, or tracks your text.

### What is the difference between camelCase and PascalCase?

In camelCase, the first word begins with a lowercase letter and every subsequent word is capitalized ('myVariableName'). In PascalCase, every word including the first begins with a capital letter ('MyVariableName').

### Can I convert lists of database columns or code variables line by line?

Yes. Check the 'Convert line by line' option to transform each line independently, making it easy to convert lists of database columns, CSV headers, or programming identifiers.

### How do I convert text case without this page?

Extract words by splitting on whitespace, underscores, hyphens, and camelCase transitions (regex /([a-z\d])([A-Z])/g, '$1 $2'). For lowercase: text.toLowerCase(). For UPPERCASE: text.toUpperCase(). For Title Case: capitalize first letter of each word. For Sentence case: capitalize first letter of each sentence following [.!?]. For camelCase: lowercase word 0, capitalize words 1..N, join with ''. For PascalCase: capitalize all words, join with ''. For snake_case: lowercase all words, join with '_'. For kebab-case: lowercase all words, join with '-'. For CONSTANT_CASE: uppercase all words, join with '_'.

## Related tools

- [Slug generator](https://plaintools.io/seo/slug-generator.md) — HTML: https://plaintools.io/seo/slug-generator
- [Text diff checker](https://plaintools.io/dev/text-diff-checker.md) — HTML: https://plaintools.io/dev/text-diff-checker
