{ JSON Key Renamer }

// rename json keys in bulk โ€” values stay untouched

Apply find-and-replace or mapping rules to rename JSON keys in bulk without changing values. Free, browser-based, no sign-up required.

RENAME RULES
โŸณ

Ready to rename

Paste JSON, set rules, and click Rename Keys

HOW TO USE

  1. 01
    Paste your JSON

    Drop any valid JSON object or array into the input field โ€” supports deeply nested structures.

  2. 02
    Choose a mode & add rules

    Use Find & Replace to rename keys by pattern, or Key Mapping to specify exact old โ†’ new names.

  3. 03
    Click Rename Keys

    Instantly get your renamed JSON. Values are never touched โ€” only key names change.

FEATURES

Find & Replace Key Mapping Deep / Recursive Values Preserved Multi-rule Support Arrays Handled

USE CASES

  • ๐Ÿ”ง Migrating API responses to a new schema
  • ๐Ÿ”ง Renaming snake_case keys to camelCase
  • ๐Ÿ”ง Removing or replacing key prefixes
  • ๐Ÿ”ง Adapting third-party JSON to your data model

WHAT IS THIS?

JSON Key Renamer lets you apply bulk find-and-replace or explicit key mapping rules to any JSON structure. Unlike manual editing, this tool traverses the entire object graph and renames every matching key โ€” even deep inside nested arrays and objects โ€” without ever touching the values.

RELATED TOOLS

FREQUENTLY ASKED QUESTIONS

What is the difference between Find & Replace and Key Mapping?

Find & Replace performs a substring match on every key name and replaces the matched portion. This is useful for renaming prefixes, suffixes, or common patterns across many keys at once. Key Mapping matches only exact key names and maps them to a specific new name, giving you precise control over individual keys.

Will my values change?

Never. This tool only renames keys โ€” all values (strings, numbers, booleans, arrays, nested objects) remain exactly as they were in the original JSON.

Does it work on nested objects and arrays?

Yes. When the Rename nested keys (deep) toggle is enabled, the tool recursively traverses every nested object and array, renaming matching keys at all levels. Disable the toggle if you only want to rename top-level keys.

Can I add multiple rename rules at once?

Yes. Click + Add Rule (or + Add Mapping) to insert as many rules as you need. Rules are applied in order from top to bottom. In Find & Replace mode, all rules are applied to each key sequentially, allowing chained transformations.

Is my JSON data sent to a server?

No. All processing happens in your browser via JavaScript. Your JSON data never leaves your device. The PHP backend is only invoked optionally โ€” it performs the same client-side logic on the server but no data is stored or logged.

What happens if two keys resolve to the same name?

If two different keys in the same object both rename to the same new key, the last one will overwrite the earlier one โ€” this mirrors standard JavaScript/PHP object behaviour. Always review the output to ensure no key collisions occur when using broad find-and-replace patterns.

What is a JSON Key Renamer?

A JSON Key Renamer is a developer utility that applies transformation rules to the keys of a JSON object while leaving all values completely intact. Whether you're migrating an API integration to a new schema, normalizing inconsistent key naming conventions across multiple data sources, or refactoring a large dataset before importing it into a database, a key renamer saves you from tedious manual editing and the risk of accidental value modification.

This tool supports two powerful modes: Find & Replace and Key Mapping. Find & Replace scans every key name for a substring match and substitutes it โ€” perfect for removing prefixes, converting separators, or applying global naming conventions. Key Mapping provides explicit old-to-new name pairs, giving you surgical control over specific keys without affecting anything else.

๐Ÿ’ก Looking for premium JavaScript plugins and scripts? MonsterONE offers unlimited downloads of templates, UI kits, and developer assets โ€” worth checking out.

Find & Replace Mode โ€” Rename Keys by Pattern

Find & Replace mode treats each key name as a string and performs a literal substring substitution. For example, to convert snake_case to camelCase prefixes, you might replace user_ with an empty string to strip a common prefix from all user-related fields. Multiple rules can be stacked โ€” they are applied sequentially to each key, allowing you to chain transformations:

This mode shines when you have consistent naming patterns spread across dozens or hundreds of keys and need them all updated in a single pass.

Key Mapping Mode โ€” Explicit Old โ†’ New Names

Key Mapping mode matches key names exactly and replaces them only when a perfect match is found. This is the right choice when:

For instance, mapping firstName โ†’ first_name and lastName โ†’ last_name will only affect those exact keys. A key like firstNameAlias would not be touched.

Deep (Recursive) Renaming

Modern JSON data structures are rarely flat. API responses often contain nested objects โ€” user profiles with address sub-objects, orders containing line items containing product details, and so on. The deep rename option recursively traverses every level of your JSON tree, applying your rules to keys at all nesting depths. This means a single rule can rename user_id to userId whether it appears at the root level, inside an array of users, or nested three levels deep inside a profile object.

When you need to rename only top-level keys โ€” for example, when restructuring the shape of an API wrapper without touching inner data payloads โ€” simply disable the deep toggle.

Common JSON Key Renaming Scenarios

snake_case to camelCase Migration

Many backend APIs return data in snake_case format (first_name, created_at) while JavaScript conventions favour camelCase (firstName, createdAt). Rather than transforming every key manually or writing a custom recursive function, you can paste your response payload, add individual mapping rules, and get a camelCase-ready output in seconds.

Stripping or Replacing Prefixes

Database exports and ORM serializations often include table-name prefixes in key names โ€” product_name, product_sku, product_price. Find & Replace mode lets you strip the product_ prefix from all keys at once, producing a cleaner name, sku, price structure.

API Version Migration

When a REST API bumps from v1 to v2 and renames several fields, you may need to quickly adapt stored fixtures, mock data, or test payloads to match the new contract. Key Mapping mode lets you specify the exact set of changed fields from the API changelog and transform your data in one click.

Data Normalization Before Database Import

Before importing JSON data into MongoDB, PostgreSQL's jsonb columns, or Elasticsearch, key names often need to conform to schema requirements โ€” no spaces, no hyphens, consistent casing. This tool lets you clean up key names without writing a throwaway migration script.

How JSON Key Renaming Works Under the Hood

The renaming algorithm works by recursively walking the JSON object graph. For each node encountered:

  1. If the node is a primitive (string, number, boolean, null), it is returned unchanged.
  2. If the node is an array, each element is processed recursively (when deep mode is enabled).
  3. If the node is an object, each key is passed through the active rename rules to produce a new key name, and each value is processed recursively (when deep mode is enabled).

This means the algorithm runs in O(n) time relative to the total number of nodes in your JSON tree โ€” fast enough to handle large payloads entirely in the browser without any server round-trip.

Browser-Based & Privacy-First

All processing happens in your browser using JavaScript. Your JSON data never leaves your device โ€” there are no uploads, no server logs, and no storage of your data. This makes the tool safe to use with confidential API payloads, internal data schemas, or production database exports that you wouldn't want passing through a third-party server.

Tips for Using JSON Key Renamer Effectively

โ˜•