JSON Keys to camelCase

Convert all JSON object keys to camelCase. Paste your JSON and get instant results with nested object support.

Convert to:
Try:

Why Convert JSON Keys to camelCase?

Most JavaScript and TypeScript codebases follow the camelCase convention for variable and property names. However, APIs built with Python (Django, Flask), Ruby (Rails), or Go often return JSON with snake_case keys like user_first_name or created_at.

Converting these keys to camelCase (userFirstName, createdAt) keeps your frontend code consistent and avoids mixing naming conventions within the same codebase.

How the Conversion Works

The converter handles multiple source formats:

  • user_name (snake_case) → userName
  • user-name (kebab-case) → userName
  • UserName (PascalCase) → userName
  • user.name (dot.case) → userName

Nested objects and arrays of objects are processed recursively — every key at every depth level is converted.

Common Use Cases

  • Consuming REST APIs from Python/Ruby backends in a React frontend
  • Normalizing third-party API responses before storing in state
  • Converting database query results for GraphQL resolvers
  • Migrating JSON configuration files between conventions
  • Preparing mock data for JavaScript unit tests

JSON Keys to camelCase in Code

In production, you would typically use a library like camelcase-keys (npm) or write a recursive function. This online tool is useful for quick one-off conversions, debugging API responses, or converting sample data without writing code.

FAQ

Does this tool modify JSON values?

No. Only the keys (property names) are converted. All values — strings, numbers, booleans, nulls, nested objects, and arrays — remain unchanged.

What about keys with numbers?

Keys containing numbers are handled correctly. For example, item_2_name becomes item2Name.

Related Tools