Rename a key everywhere it appears in a JSON document — at any depth, inside arrays too — with an occurrence count and overwrite warnings.
Show calculation steps
Processed privately in your browser — nothing you paste is uploaded, logged or stored.
One rename, every occurrence
APIs change field names; codebases migrate conventions; a typo ships. Renaming a key by hand across a deep document with arrays is error-prone — this tool renames every occurrence at every depth in one pass, reports how many places changed, and warns if the rename overwrote an existing key rather than silently merging.
Worked example
Renaming user_name → username:
{
"user_name": "Asha",
"details": { "user_name": "asha.k" },
"history": [ { "user_name": "old-alias" } ]
}Output — 3 occurrences renamed:
{
"username": "Asha",
"details": { "username": "asha.k" },
"history": [ { "username": "old-alias" } ]
}When to use it
- Adapting a payload to an API that renamed a field between versions.
- Migrating fixtures from snake_case to camelCase one key at a time.
- Fixing a misspelled key across a large document.
Limitations to know
- Matching is by key name everywhere — path-scoped renames (only under
$.user) are not supported; extract the subtree first if you need that. - One rename pair per run, on purpose: chained runs are safer than bulk mappings, and the output drops straight back into the input.
Common errors and fixes
- “0 occurrences renamed” — check case (the match is case-sensitive by default) and spelling; the warning tells you nothing changed.
- Overwrite warning — the new name already existed in some object; decide whether that merge is what you wanted.
How to use the JSON Key Renamer
- Paste your JSON.
- Enter the key to rename and its new name in the options.
- Choose case-sensitive or insensitive matching.
- Click "Rename key" — the stats line reports how many occurrences changed.
Frequently asked questions
Does renaming affect keys at every depth?
Yes — the key is renamed wherever it appears: top level, nested objects, and objects inside arrays. The occurrence count in the stats line tells you exactly how many places changed.
What if the new key name already exists?
The renamed value overwrites the existing one and the tool warns you — it never silently merges. If you see that warning, check whether you actually wanted a merge or a different name.
Can I rename multiple different keys at once?
One rename per run, by design — bulk renames with different targets are where accidents happen. Run the tool repeatedly; your output can be swapped straight back into the input.
Can I rename a key only at a specific path?
Not in this version — matching is by name everywhere. If you need path-scoped renames, extract the subtree with the JSONPath Tester, rename inside it, and merge it back.