JSON Key Case Converter

Recursively transform JSON dictionary keys between camelCase, snake_case, PascalCase, kebab-case, and SCREAMING_SNAKE_CASE.

ORIGINAL JSON INPUT
TRANSFORMED JSON OUTPUT

Recursively Converting JSON Key Casing Across Multi-Tier Stacks

In modern full-stack and distributed microservice architectures, different programming ecosystems enforce conflicting naming conventions for dictionary keys, struct members, and database attributes. A frontend Single Page Application (SPA) built with React, Vue, or Angular naturally operates with camelCase identifiers. In contrast, backend services built with Python (FastAPI, Django) or PostgreSQL databases adhere strictly to snake_case, while enterprise systems written in C# (.NET) or Go require PascalCase for public struct fields and DTOs.

Manually renaming keys across sprawling API payloads or using naive global regex find-and-replace often causes catastrophic bugs—such as inadvertently corrupting string values, enum literals, or base64 blobs. Our JSON Key Case Converter solves this problem by parsing your JSON payload into an in-memory Abstract Syntax Tree (AST), recursively traversing dictionaries and arrays of objects, and transforming only the dictionary keys while leaving all string, numeric, boolean, and null data values intact.

Real-World Developer Workflows & Language Conventions

Developers and data engineers utilize automated key casing transformations across various production scenarios:

Step-by-Step Transformation Example

Consider the following user account and billing record containing nested objects and an array of payment methods in camelCase:

Input: Nested JSON Payload (camelCase)

{
  "userId": 8921,
  "accountProfile": {
    "firstName": "Grace",
    "lastName": "Hopper",
    "emailAddress": "[email protected]",
    "primaryContactNumber": "+1-555-0199"
  },
  "paymentMethods": [
    {
      "cardType": "Visa",
      "billingAddress": {
        "streetLine1": "400 Navy Way",
        "postalCode": "20374",
        "countryCode": "US"
      }
    }
  ]
}

Output: Transformed Payload (snake_case)

{
  "user_id": 8921,
  "account_profile": {
    "first_name": "Grace",
    "last_name": "Hopper",
    "email_address": "[email protected]",
    "primary_contact_number": "+1-555-0199"
  },
  "payment_methods": [
    {
      "card_type": "Visa",
      "billing_address": {
        "street_line_1": "400 Navy Way",
        "postal_code": "20374",
        "country_code": "US"
      }
    }
  ]
}

Casing Conventions Reference Guide

Casing Format Primary Ecosystems Example Key Sample Output
camelCase JavaScript, TypeScript, Swift, Kotlin userId {"userId": 101}
snake_case Python (PEP 8), PostgreSQL, Ruby, Rust user_id {"user_id": 101}
PascalCase C#, .NET, Go structs, TypeScript types UserId {"UserId": 101}
kebab-case HTTP headers, URLs, Kubernetes, CSS user-id {"user-id": 101}
SCREAMING_SNAKE Constants, Environment configs, Enums USER_ID {"USER_ID": 101}

Key Transformation Rules, Edge Cases & Collision Safety

Reliable dictionary key transformation requires careful handling of delimiters, compound words, and nested structures:

  1. Recursive AST Traversal: The converter recurses through objects and arrays of arbitrary depth. When an array is encountered, each member item is inspected and transformed individually.
  2. Strict Value Isolation: String literals, numeric values, booleans, and nulls are never modified. Only object keys (the left-hand property identifiers) undergo casing transformation.
  3. Compound Delimiter Normalization: Input keys with irregular delimiters (such as user-account_profile.id) are tokenized into constituent words before applying the target casing rules.
  4. Numerical Suffix Handling: Alphanumeric keys like streetLine1 or ipv6Address are preserved cleanly. Boundaries between lower-case letters and numbers are respected to prevent accidental data mangling.
  5. Key Collision Prevention: If two input keys in the same object differ only by casing (e.g. userName and user_name), standard JavaScript object semantics retain the last converted property. Ensure source keys are unique before conversion.

100% Client-Side Privacy & Data Security Guarantee

API payloads, user schemas, and database extracts often contain sensitive Personally Identifiable Information (PII) or confidential business logic. Sending this data to external cloud-hosted conversion tools creates unacceptable compliance and security vulnerabilities.

JSON Empire guarantees zero data transmission:

Frequently Asked Questions

Does this case converter modify string values or nested array contents?

No. The converter parses the JSON into an in-memory object tree and only transforms the dictionary keys. All property values—including string literals, formatted numbers, booleans, nulls, and array primitives—are preserved exactly as input.

How are alphanumeric keys with numbers handled (e.g., addressLine1)?

Alphanumeric boundaries and consecutive characters are preserved cleanly. For example, addressLine1 converts to address_line_1 in snake_case and AddressLine1 in PascalCase without truncating numbers.

Can this tool handle deeply nested objects and arrays of objects?

Yes. The algorithm traverses arbitrary depths recursively, converting keys inside nested dictionaries, arrays of objects, and mixed structures.

What casing styles are supported?

The tool supports camelCase (JavaScript/TypeScript), snake_case (Python/PostgreSQL), PascalCase (C#/Go), kebab-case (URLs/CSS/Kubernetes), and SCREAMING_SNAKE_CASE (constants/environment variables).

Is my API payload sent to any remote server?

No. All conversion operations run 100% on your local machine within your web browser using client-side JavaScript. No data is logged, transmitted, or stored on any server.

Related Developer Tools & Converters

Explore companion utilities from the JSON Empire tool suite for data processing and serialization: