>_

snake_case to camelCase

snake_case is common for Python variables, Ruby, database columns and many REST APIs; camelCase is used for JavaScript / TypeScript / Java variables and JSON keys in many web APIs. Moving data between languages, databases and APIs often means converting between the two.

Examples

snake_case camelCase
user_id userId
first_name firstName
created_at createdAt
order_item_id orderItemId
is_active isActive

Try it

camelCase
 
PascalCase
 
snake_case
 
CONSTANT_CASE
 
kebab-case
 
Train-Case
 
dot.case
 
path/case
 
Title Case
 
Sentence case
 
lowercase
 
UPPERCASE
 

In code

JavaScript

const toCamel = (s) => s.replace(/_([a-z\d])/g, (_, c) => c.toUpperCase());

Python

def to_camel(s: str) -> str:
    first, *rest = s.split('_')
    return first + ''.join(w.capitalize() for w in rest)

More examples

Open the full Case Converter →