Text Utilities

Text Case Converter

Convert text between camelCase, snake_case, kebab-case and more.

Input text
📝

Enter text to start converting

Supports multiple naming formats including camelCase, snake_case, kebab-case, etc.

What is Text Case Converter?

Text case converter transforms text between different letter cases and naming conventions.

Supported Cases

  • lowercase: all lowercase
  • UPPERCASE: ALL UPPERCASE
  • Title Case: Capitalize Each Word
  • Sentence case: First letter capitalized
  • camelCase: JavaScript variable style
  • PascalCase: Class name style
  • snake_case: Python variable style
  • kebab-case: URL/CSS style

Converts text between nine cases — lower, UPPER, Title, sentence, camelCase, PascalCase, snake_case, kebab-case and CONSTANT_CASE — recalculating all nine previews on every keystroke. Useful when renaming identifiers across languages, deriving CSS class names or URL slugs, and checking how a regex-based converter treats the separators already present before committing to a bulk rename.

What each mode actually runs

Every mode is a short chain of string operations, so reading the chain predicts the result. Lower and upper are one toLowerCase() or toUpperCase() call each, using the default Unicode mapping. Title case lowercases the whole string first and then uppercases every ASCII character sitting just after a word boundary, which flattens any capital already inside a word. Sentence case touches exactly one character: the first one, with the entire remainder lowercased. The four identifier modes never tokenize anything. snake, kebab and CONSTANT insert a space before each ASCII capital, shift case, swap whitespace runs for the separator, then delete every character outside the separator class. camel and Pascal uppercase boundary matches and afterwards remove whitespace, underscores and hyphens only. So separators you already have are usually deleted, not translated.

Word boundaries are ASCII-only

The boundary anchor \b derives from \w, which is exactly [A-Za-z0-9_], so no non-ASCII letter counts as a word character. Several oddities follow directly. An apostrophe creates a boundary, so don't stop becomes Don'T Stop. Accented letters are equally non-word, so naïve café becomes NaïVe Café. An underscore is a word character, so there is no boundary after it, and camel mode turns user_id into userid. snake inserts a space before every capital, so parseXMLFile splits into parse_x_m_l_file. camel lowercases only the character at offset zero, so XMLHttpRequest becomes xMLHttpRequest, and a leading space defeats even that step.

Deletion versus translation

camel and Pascal clean up by removing whitespace, _ and - and nothing else, so dots, dollar signs and accented letters survive inside the identifier: price $5.00 becomes price$5.00. The separator modes are destructive instead, deleting anything outside [A-Za-z0-9_] or its hyphen variant, so café menu collapses to caf_menu and 世界 hello becomes _hello, with the CJK word gone and a dangling separator left behind. CONSTANT uppercases before stripping, so straße name yields STRASSE_NAME while snake gives strae_name. kebab admits underscores because _ matches \w, so user_id comes back unchanged in kebab mode.

Worked example

camelCase mode applied to an existing snake_case identifier

Input
user_id
Output
userid

The underscore is a \w character, so no word boundary exists between it and the following i; the boundary match never fires and that letter stays lowercase. The final cleanup then deletes the underscore, fusing two words into one. Pascal mode returns Userid for the same input, while snake and kebab return user_id untouched.

Limits and pitfalls

  • No maximum length is enforced in the component, but every keystroke rebuilds nine preview strings plus the active result, so very large inputs get slow rather than truncated; the counter reports UTF-16 code units, counting one emoji as two.
  • Title case lowercases before capitalising, so iPhone becomes Iphone and parseXMLFile becomes Parsexmlfile; it cannot produce titles that preserve internal capitals.
  • Sentence case changes the first character of the whole textarea only and ignores periods, question marks and line breaks, so Hello. World. becomes Hello. world.; with leading whitespace nothing is capitalised at all.
  • camel and Pascal strip whitespace, _ and - only, so punctuation and accents stay inside the result: price $5.00 yields price$5.00, not a valid identifier in most languages.
  • snake, kebab and CONSTANT delete every non-ASCII letter, so mixed Chinese/English input loses the CJK run and leaves orphan separators: emoji 👍 test becomes emoji__test.

Related tools

This page, your editor, or the neighbouring tool

SituationThis Text Case toolPick this instead
One name to settle, or a rename that spans filesA single textarea whose nine results are recomputed on every keystroke, which is what you want while you are still deciding whether a new column reads better as snake or kebab. It accepts no file and no directory, so it cannot touch a codebase.The case command built into your editor, or the Change Case extension: it rewrites every selected occurrence and leaves the whole batch on the undo stack. Switch once the convention is fixed and the job is mechanical.
The input already carries word boundaries you must keepNothing tokenizes the text. camel uppercases boundary matches and then deletes whitespace, _ and - only, so max_retry_count (15 characters) returns as maxretrycount (13) with the words welded together.change-case or the lodash camelCase() function, which split on separators and on case humps before rejoining and return maxRetryCount. Use them whenever an underscore or hyphen is carrying meaning you cannot afford to lose.
The name has to compile or be accepted by a databaseThe output is never validated. 2fa_enabled comes back as 2fa_enabled, leading digit and all, because the cleanup only deletes characters outside the separator class and never inspects the first position.Regex Tester with a pattern such as ^[a-z][a-z0-9_]*$ run over the converted list. Do that before the text reaches a migration file or a struct declaration.
A list of keys rather than one stringThe nine tiles are nine views of the same textarea. There is no line model, no dedupe and no sorting, so a key that appears twice simply appears twice in each of the nine tiles.Line Sort and Deduplicate applied to the converted list: order-id and orderid both leave snake mode as orderid, and only a dedupe pass makes that collision visible.
You must show that nothing else changedThe source and the result sit in refs and nothing is persisted, so overwriting the original with the copied result leaves no record of what moved; the counter is the only number you get.Text Diff, with the original on one side and the converted output on the other. That is the check when the text is a whole config file pasted in, not a single identifier.

One concrete scenario

Thirty-one spreadsheet headers against a 63-byte identifier limit

An analyst sends 31 CSV headers spelled the way people type them: Order ID, Customer Email, Estimated Quarterly Recurring Subscription Revenue. The tables need snake_case, and an unquoted PostgreSQL identifier stops at 63 bytes (NAMEDATALEN is 64, one byte goes to the terminator). Every header here is ASCII, so one character costs one byte. Most convert cleanly: Customer Email is 14 characters and returns customer_email, also 14. Order ID is the exception — 8 characters in, 9 out as order_i_d, because a space is inserted before each capital and the acronym splits in three. The longest header lands at 50 characters, 13 short of the cap. Trust the counter under the result box rather than the input counter, then repair the acronym headers by hand.

Frequently Asked Questions

Where do camelCase, PascalCase, snake_case, and kebab-case belong?
Mainstream conventions: camelCase for JS/Java variables and methods; PascalCase for classes, components, and types; snake_case for Python and database columns; kebab-case for CSS classes, URLs, and filenames. HTTP headers are kebab but case-insensitive. Ecosystem conventions beat personal preference.
Why do automatic converters mishandle acronyms?
"parseXMLFile" should become parse_xml_file, but naive algorithms split runs of capitals wrong (parse_x_m_l_file). The tool applies common acronym rules (consecutive capitals treated as one word), but names like APIName or HTTPServer deserve a manual glance.
Can case conversion corrupt data?
Pure ASCII is safe, but watch for non-reversible cases (German ß uppercases to SS) and case-sensitivity differences in filesystems (macOS default insensitive, Linux sensitive) — kebab-casing filenames is good hygiene against case collisions.

Content reviewed: