JSON key renamer
This tool renames one key in a JSON document, either everywhere it appears or only in the top-level object. Developers use it to switch naming styles, like first_name to firstName, or to match a field name another system expects.
- Runs in your browser
- Free, no account needed
- Copy or download the result
Result
Example
{"first_name":"Ada","team":[{"first_name":"Lin"}]}{
"firstName": "Ada",
"team": [
{
"firstName": "Lin"
}
]
}How to use the json key renamer
- Paste your JSON into the JSON box.
- Enter the old name in Current key and the replacement in New key.
- Set Where to All nested objects or Root object only.
- Press Run, then Copy result or Download.
How it works
All nested objects renames the key in every object, including objects inside arrays.
Root object only changes just the top-level object, so the JSON must start with an object, not an array.
If an object already has a key with the new name, the tool stops rather than overwriting data.
Key names are matched exactly, including case. Values are never changed.
You get an error if the key is not found, if both names are the same, or if either name is __proto__, prototype or constructor.
Everything runs in your browser. Your input is not uploaded or stored.
Questions and answers
How do I rename a key in JSON?
Paste the JSON, type the current and new key names, and press Run. The result is the same JSON with that key renamed.
Can I rename keys inside arrays of objects?
Yes, with Where set to All nested objects. Every object in every array is checked.
What happens if the new key already exists?
The tool shows an error and changes nothing, so no value is lost. Rename or remove the other key first.
Is my JSON sent anywhere?
No. Renaming happens in your browser, and the input is not transmitted.