BYTETOOLS

How to Convert Between camelCase, snake_case and More

To convert an identifier between camelCase, snake_case, kebab-case and other styles, paste it into a code case converter and it shows every case form at once so you copy the one you need. You do not pick a target format first; the tool splits your input into words and renders all seven common styles simultaneously.

This guide walks through using the converter, explains how the word-splitting works, and shows why it runs entirely in your browser.

Step-by-step

  1. Paste your identifier into the input box in whatever case it is currently written — userID, user_id, User Id, it does not matter.
  2. Let it split automatically. The tool detects word boundaries the instant you type, so there is no convert button to wait on.
  3. Read every case form — camelCase, PascalCase, snake_case, kebab-case, CONSTANT_CASE, dot.case and Title Case — laid out together.
  4. Click Copy next to the form you want and paste it into your code.

Because output updates live, you can tweak the input and instantly see how each style changes.

How the word splitting works

The quality of any case conversion comes down to how well it detects words. The Code Case Converter breaks your input on spaces, underscores, hyphens and dots, and also on camelCase humps — the point where a lowercase letter meets an uppercase one. It handles runs of capitals sensibly too, so an acronym stays intact:

InputDetected wordssnake_case output
userIDuser, IDuser_id
XMLHttpRequestXML, Http, Requestxml_http_request
first-name-fieldfirst, name, fieldfirst_name_field
MAX_RETRY_COUNTMAX, RETRY, COUNTmax_retry_count

The seven styles at a glance

  • camelCasemyVariableName, common for variables and functions.
  • PascalCaseMyVariableName, typical for classes and components.
  • snake_casemy_variable_name, common in Python and databases.
  • kebab-casemy-variable-name, common in URLs and CSS.
  • CONSTANT_CASEMY_VARIABLE_NAME, used for constants and env vars.
  • dot.casemy.variable.name, used in some config keys.
  • Title CaseMy Variable Name, for headings and labels.

Why it runs in your browser

Every conversion happens locally in JavaScript. Nothing you type is uploaded, logged or stored, so it is safe for internal field names, unreleased schemas and proprietary code. It also works offline once loaded, which is handy on a locked-down machine or a flaky connection.

Try the Code Case Converter — free and 100% in your browser.

FAQ

Do I have to choose a source format?

No. The converter detects word boundaries from any mix of separators and camelCase humps, so you paste the identifier as-is and it figures out the words for you.

Can I convert a phrase with spaces?

Yes. Spaces are treated as word separators, so Order Line Item splits into three words and renders correctly as orderLineItem, order_line_item and every other style.

What happens to numbers in my identifier?

Digits stay attached to their surrounding word, so an input like address2 keeps the 2 with address rather than treating it as a separate token.

Is there a limit on length?

There is no practical limit for typical identifiers. Since it all runs locally, you can convert long, multi-word names without any round trip to a server.

Related free tools

Built by ByteVancer

ByteTools is a free product of ByteVancer, a software and web development studio building web apps, SaaS and custom software. If your team wrestles with naming conventions across a large codebase, explore how ByteVancer can help design and build cleaner systems.