Case Converter — Free Online Tool
Convert text case: camelCase, PascalCase, snake_case, kebab-case, UPPERCASE, lowercase, Title Case. Batch convert variable names, identifiers, strings.
Use this free online Case Converter directly in your browser. No signup required, no data leaves your device. Part of Utilier — a collection of 133+ developer utilities.
What is Case Converter (camelCase, snake_case, kebab-case, UPPERCASE, Title Case)?
Case converter transforms text between naming conventions (camelCase, snake_case, kebab-case, PascalCase, UPPERCASE, lowercase, Title Case). Converts: 'hello world' → camelCase: helloWorld, snake_case: hello_world, kebab-case: hello-world, PascalCase: HelloWorld, UPPER_SNAKE: HELLO_WORLD, Title Case: Hello World. Features: batch conversion (paste list of variables, convert all), preserve numbers/special chars (get2FACode → get_2fa_code), smart splitting (parseHTMLString → parse_html_string), copy all formats at once. Use cases: refactoring (Python snake_case → JS camelCase), API consistency (ensure all keys camelCase), renaming variables, generating identifiers.
- camelCase: First word lowercase, subsequent words capitalized (no separators). Example: helloWorld, getUserById, parseHTMLString. Common in: JavaScript, Java (variables, methods). Compact, readable.
- snake_case: Lowercase words separated by underscores. Example: hello_world, get_user_by_id, parse_html_string. Common in: Python, Ruby, SQL, C. Clear word boundaries.
- kebab-case: Lowercase words separated by hyphens. Example: hello-world, get-user-by-id, parse-html-string. Common in: URLs, CSS classes, file names. URL-safe, readable.
- PascalCase: All words capitalized (no separators). Example: HelloWorld, GetUserById, ParseHTMLString. Common in: class names (Java, C#, JavaScript), React components. Distinguishes classes from variables.
- Multiple formats at once: Enter text once → generates all formats simultaneously. Input: 'get user by id' → camelCase: getUserById, snake: get_user_by_id, kebab: get-user-by-id, Pascal: GetUserById, UPPER: GET_USER_BY_ID. Copy needed format.
Why use case converter?
Maintain naming convention consistency across codebase. Quick conversion when switching languages (Python ↔ JS).
- Refactoring (language switch): Python code uses snake_case (get_user_data). Porting to JavaScript: need camelCase (getUserData). Convert 100+ variable names: paste list → convert all → copy camelCase results. Faster than manual.
- API consistency: API responses use camelCase. Database columns use snake_case. Convert: user_id (DB) → userId (API). Or enforce: all API keys camelCase (firstName, lastName, phoneNumber). Check existing keys.
- Naming convention enforcement: Team standard: JavaScript uses camelCase (functions/variables), PascalCase (classes/components). Review: UserService (correct: PascalCase), getUserData (correct: camelCase), get_user_data (wrong: snake_case → convert to getUserData).
- URL generation from titles: Blog post: 'How to Use React Hooks' → URL slug: how-to-use-react-hooks (kebab-case). Article title → kebab converter → paste in slug field. SEO-friendly, readable URLs.
- Variable renaming: Inherited code: inconsistent naming (getUser, get_post, GetComment). Standardize to camelCase: get_post → getPost, GetComment → getComment. Consistent → easier to read/maintain.
- Code generation: Database table: user_profiles. Generate TypeScript interface: UserProfiles (PascalCase class), userProfiles (camelCase variable). Or GraphQL type: UserProfile. Quick name generation from DB schema.
When to use case converter
Use whenever converting between naming conventions.
- Refactoring code to different language (Python snake_case → JS camelCase).
- Enforcing coding standards (ensure all variables camelCase).
- Generating URLs from titles (title → kebab-case slug).
- Converting API responses (DB snake_case → JSON camelCase).
- Renaming variables batch (paste list, convert all).
- Creating identifiers from descriptions (My Tool → myTool, my_tool, my-tool).
- Reviewing code (check if naming follows conventions).
- Generating code from schemas (DB table names → class names).
How to use case converter
Enter text, see all case formats instantly. Copy needed format.
- Enter text (any format): Type: 'hello world', 'Hello World', 'hello-world', 'hello_world', 'helloWorld', or 'HelloWorld'. Tool detects format, splits into words automatically. Works with existing code (variable names).
- View all formats: Instantly shows: camelCase (helloWorld), PascalCase (HelloWorld), snake_case (hello_world), kebab-case (hello-world), UPPER_SNAKE_CASE (HELLO_WORLD), lowercase (hello world), Title Case (Hello World), UPPERCASE (HELLO WORLD).
- Copy format needed: Click copy button next to format. Or select text manually. Use in code editor. Example: copy camelCase result → paste as JavaScript variable name.
- Batch convert (multiple items): Paste list (newline-separated): 'get user\nupdate profile\ndelete post'. Tool converts each line independently → outputs all in selected format. Copy all results. Useful for renaming many variables.
- Handle special cases: Numbers preserved: 'get2FACode' → 'get_2fa_code' (snake), 'get-2fa-code' (kebab). Acronyms handled: 'parseHTMLString' → 'parse_html_string'. Special chars stripped (before conversion).
- Use presets (examples): Click example preset: 'getUserById', 'user_profile_data', 'create-new-post'. See conversions. Experiment with different inputs (test tool behavior).
Key features
- Multiple formats simultaneously: Enter once → generates: camelCase, PascalCase, snake_case, kebab-case, UPPER_SNAKE_CASE, lowercase, Title Case, UPPERCASE (8 formats). Copy any format needed. No re-entering text.
- Smart word splitting: Detects existing format: 'helloWorld' (camelCase) → splits 'hello', 'world'. 'parse_html_string' (snake) → 'parse', 'html', 'string'. Handles mixed case, separators (-, _), acronyms (HTML, ID, API).
- Number preservation: 'get2FACode' → snake: 'get_2fa_code', kebab: 'get-2fa-code', camel: 'get2FaCode'. Numbers stay in place (not removed). Example: 'base64Encode' → 'base_64_encode'.
- Batch conversion: Paste list (newline-separated): multiple variable names. Select output format (camelCase, snake, etc.). Tool converts all lines → outputs results as list. Copy all. Faster than one-by-one.
- Special character handling: Strips before conversion: 'hello@world!' → 'helloWorld'. Preserves during: 'hello_world@2023' → 'helloWorld2023' (@ removed, 2023 kept). Ensures valid identifiers (no @, !, spaces in output).
- One-click copy: Copy button for each format. Click → clipboard. Or select text (manual copy). Quick paste into code editor. No typing (reduces errors).
- Real-time conversion: Type in input → all formats update instantly (no submit button). See results as you type. Experiment with different inputs (immediate feedback).
Common use cases
- Python to JavaScript refactor: Python function: get_user_by_id(user_id). Convert to JS: getUserById(userId). Input: 'get_user_by_id' → camelCase: getUserById. Repeat for all functions/variables. Maintain logic, change naming convention.
- Database to API mapping: Database column: first_name (snake_case). API response: firstName (camelCase). Convert in ORM: db.first_name → {firstName: db.first_name}. Tool: verify correct conversion (first_name → firstName).
- CSS class naming: Component: UserProfileCard. CSS class should be: user-profile-card (kebab-case). Input: 'UserProfileCard' → kebab: user-profile-card. Use in HTML: class='user-profile-card'. BEM convention: block__element--modifier.
- URL slugs from titles: Article: 'Best Practices for React Hooks'. Slug: 'best-practices-for-react-hooks' (kebab). Input title → kebab-case → copy slug. SEO-friendly URL: example.com/blog/best-practices-for-react-hooks.
- TypeScript interface generation: API response: {user_id, first_name, created_at} (snake from DB). TS interface: {userId, firstName, createdAt} (camel). Convert each field: user_id → userId. Generate: interface User {userId: number; firstName: string; createdAt: Date;}.
- GraphQL schema naming: Database table: user_profiles. GraphQL type: UserProfile (PascalCase). Query: userProfile (camelCase). Convert table name: user_profiles → PascalCase: UserProfile (type), camelCase: userProfile (query).
Examples
Common case conversions with different input formats.
Simple phrase
hello worldcamelCase: helloWorld
PascalCase: HelloWorld
snake_case: hello_world
kebab-case: hello-world
UPPER_SNAKE_CASE: HELLO_WORLDSpace-separated input → all formats. Most common conversion.
Existing camelCase
getUserByIdPascalCase: GetUserById
snake_case: get_user_by_id
kebab-case: get-user-by-id
UPPER_SNAKE_CASE: GET_USER_BY_IDTool detects camelCase (capitals = word boundaries). Converts to other formats.
Existing snake_case
user_profile_datacamelCase: userProfileData
PascalCase: UserProfileData
kebab-case: user-profile-data
Title Case: User Profile DataUnderscores = word separators. Converts to formats without underscores.
With numbers
get2FACodesnake_case: get_2fa_code
kebab-case: get-2fa-code
PascalCase: Get2FaCode
UPPER_SNAKE: GET_2FA_CODE2FA stays together (or splits to 2, FA). Numbers preserved. Example: base64Encode → base_64_encode.
Acronym handling
parseHTMLStringsnake_case: parse_html_string
kebab-case: parse-html-string
Title Case: Parse Html StringHTML (consecutive capitals) = one word. Tool splits: parse, HTML, String. Result: parse_html_string.
Technical reference
Case conversion specifications and format rules:
- camelCase
- First word lowercase, subsequent words capitalized (no separators). Example: helloWorld, getUserById, parseHTMLString. Used in: JavaScript, Java, TypeScript (variables, methods, functions). Starts lowercase (distinguishes from PascalCase classes).
- PascalCase
- All words capitalized (no separators). Example: HelloWorld, GetUserById, ParseHTMLString. Used in: class names (Java, C#, JS), React components (UserProfile), TypeScript interfaces (IUser). Starts uppercase.
- snake_case
- Lowercase words separated by underscores. Example: hello_world, get_user_by_id, parse_html_string. Used in: Python, Ruby, Rust (variables, functions), SQL (table/column names), C (functions). Clear word boundaries.
- kebab-case
- Lowercase words separated by hyphens. Example: hello-world, get-user-by-id, parse-html-string. Used in: URLs, file names, CSS classes, HTML attributes. URL-safe (no encoding needed). Also: spinal-case, lisp-case.
- UPPER_SNAKE_CASE
- Uppercase words separated by underscores. Example: HELLO_WORLD, MAX_CONNECTIONS, API_KEY. Used in: constants (JavaScript, Python: const MAX_RETRIES = 3), environment variables (DATABASE_URL), config (PORT=3000).
- Title Case
- Each word capitalized, spaces preserved. Example: Hello World, Get User By Id. Used in: headings, titles, UI labels. Minor words lowercase (optional): 'The Best of Times' (The lowercase, not strict Title Case).
- lowercase
- All lowercase, spaces preserved. Example: hello world. Used in: plain text, some file names (readme.md). No separators (spaces remain).
- UPPERCASE
- All uppercase, spaces preserved. Example: HELLO WORLD. Used in: emphasis, acronyms, SQL keywords (SELECT, FROM). No separators.
- Word splitting logic
- Detects: capital letters (camelCase: 'helloWorld' → 'hello', 'world'), underscores (snake_case: 'hello_world' → 'hello', 'world'), hyphens (kebab-case: 'hello-world' → 'hello', 'world'), spaces. Acronyms: consecutive capitals (HTMLParser → HTML, Parser).
- Number handling
- Numbers preserved in position. '2FACode' → 'two_fa_code' (if converting: two f a code), or '2_fa_code' (if preserving: 2 fa code). Most tools: keep digit as-is ('get2FACode' → 'get_2fa_code'). No word splitting on digits.
Common mistakes to avoid
Manually retyping for each format (slow, error-prone)
Why it happens: Need variable in 3 formats: camelCase (JS), snake_case (Python), kebab-case (URL). Manually type each: getUserById, get_user_by_id, get-user-by-id. Risk: typo (get_user_by_Id, missing underscore).
How to avoid it: Use tool: enter 'get user by id' once. Copy each format. Faster (no retyping), no typos (generated correctly). Or paste existing format (getUserById) → get all others.
Inconsistent acronym casing (parseHTMLstring vs parseHtmlString)
Why it happens: Acronym HTML: all caps or capitalized first letter? parseHTMLString (HTML all caps) vs parseHtmlString (only H capitalized). Inconsistent across codebase (getUserID vs getUserId). Hard to search.
How to avoid it: Use tool to standardize. Input: 'parse HTML string' → camelCase: parseHtmlString (consistent: only first letter of each word capitalized). Or define standard: all caps in middle (parseHTMLString). Tool follows one rule.
Wrong format for language (snake_case in JavaScript)
Why it happens: JavaScript convention: camelCase (getUserById). Using snake_case (get_user_by_id) violates style guide (ESLint error). Inconsistent with libraries (React: useState, useEffect = camelCase).
How to avoid it: Follow language conventions: JavaScript/TypeScript = camelCase (variables, functions), PascalCase (classes, components). Python = snake_case. Use tool to convert: get_user_by_id → getUserById for JS.
Spaces in identifiers (hello world instead of helloWorld)
Why it happens: JavaScript: let hello world = 5 (syntax error: spaces invalid in variable names). Must use: helloWorld, hello_world, or hello-world (object keys: {'hello-world': 5}).
How to avoid it: Convert spaces to valid format: 'hello world' → camelCase: helloWorld (no spaces). Use tool: paste phrase → copy camelCase/snake/kebab (all valid identifiers).
Not preserving meaning (get user → getUsr, missing letters)
Why it happens: Shortening 'user' to 'usr' loses clarity. getUsr: what is usr? New developer confused. Or getUserById → getUsrById (inconsistent: full 'By' but abbreviated 'Usr').
How to avoid it: Keep full words in conversions. Tool preserves: 'get user by id' → getUserById (all words intact: get, user, by, id). Don't abbreviate unless necessary (very long names).
Frequently asked questions
What's the difference between camelCase and PascalCase?
camelCase: first word lowercase (getUserById). PascalCase: all words capitalized (GetUserById). Use camelCase for variables/functions, PascalCase for classes/components (convention in JS/TS/Java).
Which format should I use for URLs?
kebab-case (hello-world). URL-safe (no encoding needed), readable (clear word boundaries). Example: example.com/blog/best-practices-for-react. Avoid: underscores (hello_world, less common), camelCase (helloWorld, hard to read in URLs).
How do I convert a list of variables at once?
Paste list (newline-separated): 'get user\nupdate profile\ndelete post'. Select output format (camelCase). Tool converts all: getUser, updateProfile, deletePost. Copy results. Faster than one-by-one.
Does the tool handle acronyms like HTML, API, ID?
Yes. parseHTMLString → snake: parse_html_string (HTML as one word). Or parseHtmlString → parse_html_string (Html split to h, t, m, l? No: H capitalized = word boundary, HTML = one word). Consecutive capitals = acronym.
Can I convert database columns to API field names?
Yes. Database: first_name (snake). API: firstName (camelCase). Input: 'first_name' → copy camelCase: firstName. Use in API response: {firstName: db.first_name}. Or batch convert all columns.
Why use UPPER_SNAKE_CASE for constants?
Convention: constants = UPPER_SNAKE_CASE (MAX_RETRIES, API_KEY). Distinguishes from variables (maxRetries). Easy to identify: all caps = value doesn't change. Common in: JS (const), Python, environment vars (DATABASE_URL).
What if input has special characters (@, !, #)?
Tool strips special chars before conversion. 'hello@world!' → 'helloWorld' (@ and ! removed). Ensures valid identifiers (no symbols in variable names). Numbers preserved: 'hello123' → 'hello123'.
References
Privacy and availability
- Runs entirely in your browser — zero server processing
- No signup or account required
- Works offline once loaded
- Fast, lightweight, no external dependencies
- Available as a browser extension for Chrome and Firefox