Aa

camelCase Converter — Transform Text to camelCase Instantly

This camelCase converter turns any phrase into a valid code identifier instantly — "user first name" becomes "userFirstName" in one click. JavaScript, TypeScript, Java, Swift, and Kotlin all require camelCase for variables and functions. REST APIs from Stripe, GitHub, and Discord use camelCase JSON keys. The converter also handles snake_case and kebab-case input: "user_first_name" and "user-first-name" both convert correctly to "userFirstName". No signup, no character limit.

Advertisement
Words: 0Characters: 0Characters (no spaces): 0Sentences: 0Lines: 0
Advertisement

What is camelCase?

The camelCase converter joins words without spaces and capitalizes each word boundary — "user profile picture" becomes "userProfilePicture" instantly. Use it for JavaScript and TypeScript variables, JSON property keys, React component props, and Java method names. The first word stays fully lowercase; all subsequent words get a capital first letter.

Example
hello world examplehelloWorldExample

Key Features

Converts snake_case & kebab-case Too

Underscores and hyphens are treated as word separators — "user_first_name" and "user-first-name" both convert to "userFirstName" correctly. Ideal for transforming database column names or CSS property names into JavaScript identifiers.

Handles Numbers Without Breaking

"user2 name" becomes "user2Name" — numbers stay in place and the next word still capitalizes. Leading numbers are preserved as-is (note: JavaScript identifiers cannot start with a number).

Safe for Internal Project Names and Unreleased API Schemas

Your code identifiers and API field names never leave your device. Nothing is transmitted to any server — safe for internal project names and unreleased API schemas.

Multi-Line Batch Conversion — One Identifier Per Line

Paste a full list of column headers, API field names, or design spec labels — one per line — and get all converted to camelCase in one pass. Ideal for bulk-processing database column names into TypeScript interface fields.

Before & After: camelCase Examples

Real input → output pairs showing exactly how the converter behaves

InputcamelCase Output
hello worldhelloWorld
first namefirstName
get user by idgetUserById
on button clickonButtonClick
user_first_nameuserFirstName

When to Use camelCase

✓ Use it for

Use camelCase for JavaScript/TypeScript variables, function names, object properties, JSON keys, and method names in Java, Swift, and Kotlin. It is the default convention in most object-oriented and scripted languages.

✗ Avoid it for

Do not use camelCase for Python code (use snake_case per PEP 8), CSS class names (use kebab-case), environment variables (use CONSTANT_CASE), or file names (use kebab-case).

camelCase vs Other Formats

FormatExampleBest For
camelCaseuserFirstNameJS/TS variables, functions, JSON keys, React props, event handlers (onClick, onChange), ORM field mapping
PascalCaseUserFirstNameReact component names, TypeScript classes/interfaces, Java/C# class names, constructor functions
snake_caseuser_first_namePython variables/functions, SQL column names, database schemas, file names on Unix systems
kebab-caseuser-first-nameURL slugs, CSS class names, HTML data-* attributes, npm package names, CLI flags

Who Should Use This Tool?

JavaScript & TypeScript Developers

Convert plain-English field names to valid camelCase variables, function names, and object keys following Google JS Style Guide, Airbnb Style Guide, and TypeScript ESLint naming conventions.

API & Backend Developers

Transform database snake_case column names (user_id, created_at) into camelCase JSON keys for REST and GraphQL API responses served to JavaScript frontends.

Mobile App Developers

Swift and Kotlin both require camelCase for variables and function names — convert specification text or design docs into ready-to-use identifiers without typos.

Industry Standard

camelCase is mandated by the Google JavaScript Style Guide, Airbnb JavaScript Style Guide, and Oracle Java Code Conventions for variable and method names. It is the most widely adopted naming convention in web development.

camelCase Rules: How It Works

How camelCase Is Formed
  • First word is fully lowercase — "hello world" → "helloWorld"
  • Every subsequent word starts with an uppercase letter
  • Spaces, hyphens, and underscores are removed (treated as word separators)
  • Numbers stay in place — "user2 name" → "user2Name"
Do NOT Use camelCase For
  • ×CSS class names — use kebab-case (.my-class, not .myClass)
  • ×Python variables and functions — use snake_case (PEP 8 explicitly bans camelCase)
  • ×Class or component names — use PascalCase (MyComponent, not myComponent)
  • ×URL slugs and npm package names — use kebab-case (my-package, not myPackage)

How to Use This camelCase Converter

  1. Paste or type your text into the Input Text box on the left.
  2. The output is converted to camelCase instantly on the right.
  3. Click Copy to copy the result to your clipboard.
  4. Use Clear to reset and convert new text.

Key Use Cases

  • Convert spreadsheet column headers ("First Name", "Date of Birth") into valid JavaScript object keys for data processing scripts and TypeScript interface definitions.
  • Transform database snake_case column names (user_id, created_at, first_name) into camelCase JSON keys when building a REST API with Express.js, Fastify, or NestJS — or mapping Prisma/TypeORM query results to TypeScript types.
  • Generate React prop and event handler names — "on button click" → "onButtonClick", "is loading" → "isLoading" — matching React's required camelCase convention for all JSX props and DOM event callbacks.
  • Format Stripe, GitHub, or Discord API field names from documentation into camelCase variables for your JavaScript/TypeScript client code, matching the camelCase convention these SDKs use natively.
  • Produce consistent camelCase variable names from user story text or Figma design spec labels during rapid TypeScript interface design sessions.

camelCase in Programming Languages

JavaScriptlet userName = 'John';
TypeScriptconst firstName: string = 'John';
JavaString getUserName() { }
Swiftvar firstName = "John"
Kotlinval userName: String

This Converter vs Manual Methods

MethodLimitation
Manual typing in the editorError-prone at speed — easy to miss a capital on word boundaries in long identifiers
VS Code multi-cursor editingRequires keyboard shortcuts; no bulk conversion of multiple identifiers at once
IDE "Rename" refactorOnly works on identifiers that already exist in code — cannot create new names from plain English
Regex replace in terminal (sed/awk)Requires regex knowledge; fails on edge cases like acronyms and mixed separators
This converterNone — free, instant, browser-based, handles all input formats

Common Mistakes & Pro Tips

  • !Using camelCase for CSS class names — CSS uses kebab-case for class names and custom properties. "backgroundColor" in a .css or .scss file will not work; use "background-color" instead. In React inline styles, a JavaScript object is correct so camelCase applies ("backgroundColor: 'red'") — but this only works inside the style prop, never in a stylesheet.
  • !Confusing camelCase with PascalCase — camelCase starts with a lowercase letter ("myFunction"); PascalCase starts with an uppercase letter ("MyFunction"). React enforces this distinction: a lowercase-first tag like is treated as a built-in HTML element, not a component. ESLint's camelcase rule and TypeScript's @typescript-eslint/naming-convention rule flag violations automatically.
  • !Handling acronyms inconsistently — "XML parser" becoming "xMLParser" is wrong. Modern style guides (Google TypeScript, Airbnb) treat acronyms as regular words: "xmlParser", "apiClient", "htmlEncoder". Microsoft .NET recommends "XmlParser" (first letter only capitalized). Pick one rule and enforce it with a linter — mixing "XMLParser" and "xmlParser" in the same codebase breaks case-conversion round-trips.

Frequently Asked Questions

Everything you need to know about camelCase

What is the difference between camelCase and PascalCase?

+

Both join words without spaces and capitalize each word — the only difference is the first letter. camelCase starts with a lowercase letter: "myVariableName". PascalCase (also called UpperCamelCase) starts with an uppercase letter: "MyVariableName". In JavaScript and TypeScript, camelCase is used for variables, functions, and object keys; PascalCase is used for classes, React components, and TypeScript type/interface names. React enforces this: a lowercase-first tag like <myComponent> is treated as an HTML element, not a custom component.

Does camelCase work for JSON keys?

+

Yes — and it is the dominant convention for JSON APIs. JSON keys are strings and can technically use any characters, but camelCase is the standard followed by REST APIs from Stripe, GitHub, Discord, Shopify Storefront, and most modern JavaScript-first frameworks. Some older or Ruby-on-Rails-based APIs use snake_case JSON keys. If your API returns snake_case keys in a JS/TypeScript frontend, convert them at the API boundary using a single transformation function or a library like camelcase-keys.

Which programming languages use camelCase?

+

JavaScript and TypeScript (variables, functions, methods, object keys), Java (variables, methods — enforced by Oracle Code Conventions since 1995), Swift (variables, functions), Kotlin (variables, functions), C# (local variables and method parameters), and Go (unexported/private identifiers — exported identifiers use PascalCase). Python is the notable exception — PEP 8 explicitly requires snake_case for all function and variable names and discourages camelCase.

What happens to numbers in camelCase conversion?

+

Numbers are preserved in the output but do not trigger a new word capitalization. "user2 name" becomes "user2Name" — the "2" stays attached to "user" and the next word capitalizes normally. Leading numbers are preserved as-is, though technically JavaScript identifiers cannot start with a number — so "2fast" would produce "2fast" which is an invalid JS variable name.

Can I convert snake_case to camelCase with this tool?

+

Yes. The converter treats underscores as word separators, just like spaces. "user_first_name" converts correctly to "userFirstName". The same applies to kebab-case: "user-first-name" → "userFirstName". This makes the tool ideal for transforming PostgreSQL, MySQL, or SQLite column names (snake_case convention) or CSS property names (kebab-case) into JavaScript variable names in one step.

How should acronyms like XML, API, HTML be handled in camelCase?

+

There is no single universal rule, but modern style guides converge on treating acronyms as regular words — capitalize only the first letter: xmlParser, apiClient, htmlEncoder. Google TypeScript Style Guide and Airbnb JavaScript Style Guide both recommend this approach because it makes word boundaries unambiguous and allows safe round-trip conversion between cases. Microsoft .NET recommends capitalizing the first two letters of two-letter acronyms (IO → IO) and only the first letter of longer ones (Xml, Html). This converter lowercases the entire first-word position and capitalizes only the first letter of acronyms in subsequent word positions.

Why does Python use snake_case instead of camelCase?

+

PEP 8 — Python's official style guide, co-authored by Guido van Rossum — explicitly requires snake_case for function and variable names and discourages camelCase, citing readability. The Python community considers "user_first_name" more readable than "userFirstName". Python uses PascalCase only for class names (same as other languages). If you work across a Python backend and a JavaScript/TypeScript frontend, convert snake_case API fields to camelCase at the API boundary — rather than mixing conventions in either codebase.

Related Tools

FM
Written by Foysal Mostafa · Developer & Tool Builder · Last reviewed: September 1, 2026
Advertisement