Skip to content
🐫

Camel Case Converter

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

Runs in your browser

Updated

Converted

Detected words how the source was split

-

The source is split on spaces, dashes, underscores and dots, and also at existing camelCase humps, so userFirstName and user_first_name both give the same three words. Acronyms such as parseHTMLString are kept together rather than split into P, A, R, S, E.

One splitter, ten output shapes

The page holds a single source box and a fixed list of ten target shapes: camelCase, PascalCase, snake_case, kebab-case, CONSTANT_CASE, dot.case, path/case, TRAIN-CASE, Sentence case and Title Case. Nothing is typed per target. The splitter runs first and every shape is rebuilt from the same word list, so the rows cannot disagree about where a boundary falls. Sample and Clear sit above the grid, and each row has a Copy button that briefly changes its own label.

A worked example

The box loads holding user first name, which splits to three words, so the detected-words line reads 3: user | first | name. The ten values come out as userFirstName, UserFirstName, user_first_name, user-first-name, USER_FIRST_NAME, user.first.name, user/first/name, USER-FIRST-NAME, user first name and User First Name.

How boundaries are found

Four passes insert spaces before separators do the work: a lowercase letter or digit followed by a capital, a run of capitals followed by a capital and a lowercase letter, and either direction of a letter touching a digit. Splitting then falls on anything that is not a letter or digit. That is why parseHTMLString yields parse, HTML, String rather than one letter at a time, and why userFirstName and user_first_name produce the same grid.

Which rows keep capitals

All-uppercase words survive untouched into camelCase and PascalCase, so parseHTMLString round-trips exactly. The flatten-everything families are snake, kebab, dot, path, constant and train, and Title Case flattens first as well, which is why it prints Parse Html String for that input.

Where it stops

  • Only ASCII letters count as words, so accented or non-Latin input sheds those characters or reports none detected.
  • No identifier safety is checked: a leading digit stays leading in camelCase.
  • The Sentence case row is fully lowercase, so it is a plain-word view rather than a sentence.
  • One source at a time, no file input, nothing stored.

Questions people ask

Which form suits a database column?

The caption under each row states its usual home: snake_case for Python and SQL columns, CONSTANT_CASE for environment variables.

Can it just change the case?

No, this page always resegments the text. For simple upper or lowercase swaps use the case converter; for a hyphenated web address, the slug generator.