Developer Tools
JSON Key Renamer
Rename JSON object keys using literal, regex, or dot-path rules. Live preview, per-rule hit counts, collision detection, copy or download the result.
Paste any JSON document. Objects, arrays, nested structures, and strings, numbers, booleans, and null values are all supported.
Rename rules
Each rule maps a source key (or pattern, or path) to a new key. Rules apply in order; the first match for a key wins. Disabled rules are skipped.
- Rule 1Renames: 2
- Rule 2Renames: 1
- Rule 3Renames: 1
- Rule 4Renames: 1
- Rule 5Renames: 4
- Rule 6Renames: 2
Literal mode renames every occurrence of the exact key anywhere in the document.
Regex mode uses a JavaScript RegExp. The To field is a replacement template; $1..$9 references capture groups, $& the whole match, $$ a literal dollar sign.
Path mode targets a key at a specific location. Use dots for object keys and [n] or [*] for array indices. Example:posts[*].post_id
Output format
Pick the indent style. Minified strips every whitespace.
Active rules
6
Enabled rules with a non-empty From.
Total renames
11
Conflicts
0
Renames skipped to avoid clobbering an existing key.
Output size
494 chars
Everything runs in your browser. The JSON you paste here and the rules you define never leave your device.
How to use
- Paste your JSON document into the source field. Use Format input to pretty-print the source first if it helps you read the structure.
- Add rules with Add literal, Add regex, or Add path. The sample loads several example rules so you can see each mode in action.
- For literal rules, type the exact source key in From and the new key in To. Turn on Case-insensitive if you want Id, ID, and id to all match.
- For regex rules, type a JavaScript pattern in From and a replacement template in To. Use $1 through $9 to reference capture groups and $& for the whole match.
- For path rules, type a dot-notation path in From like users[*].id and the new key name in To. Use [n] for a specific array index, [*] for any element, and * for any object key.
- Reorder rules with Up and Down. The first matching rule wins for each key, so place narrower rules above broader ones.
- Pick an output style (2 spaces, 4 spaces, tab, or minified), then click Copy JSON to copy the renamed document.
About this tool
JSON Key Renamer rewrites JSON object keys using a list of rules you define, with a live preview of the renamed document, a per-rule hit count, and collision detection so renames never silently overwrite an existing key. Three rule modes are supported because real rename jobs land in three different shapes. Literal mode matches a key by exact name and renames every occurrence anywhere in the document (with an optional case-insensitive flag), which is the right tool for global normalization like rewriting Id to id everywhere or first_name to firstName everywhere. Regex mode matches keys against a JavaScript regular expression and rewrites them with a replacement template that supports $1 through $9 capture group references and $& for the whole match, which is the right tool for transforms like stripping a meta_ prefix from every key or rewriting anything ending in _at to a camelCase variant. Path mode targets a single key at a specific dot-notation location, including bracket indices for arrays and a * wildcard at any segment, which is the right tool for surgical renames like users[*].id -> userId on every element of an array without touching id fields elsewhere. Rules apply in their listed order; the first match for a key wins, so you can place broader rules below narrower ones. A live result panel renders the renamed JSON in your choice of 2-space, 4-space, tab, or minified output, with a copy button and stats tiles that show active rules, total renames, and collisions in real time. Collisions are surfaced per rule and the original key is kept rather than clobbering the conflicting existing key, so the output is always a structurally sound document. Parse errors from the source JSON are reported inline with the message the JavaScript engine produces, so you can see exactly where the input is malformed. Everything happens locally in your browser: the JSON you paste here, the rules you write, and the renamed output never leave your device, which makes the tool safe for normalizing API responses, refactoring config files, building data migration scripts, or aligning third-party payloads with your internal naming conventions.
Free to use. Works in your browser. No signup, no login.
Related tools
You may also like
JSON Key Case Converter
Rewrite every key of a JSON document into the casing style your API or client expects.
Open tool
DeveloperJSON Formatter
Format, minify, and validate JSON in your browser.
Open tool
DeveloperJSON Key Extractor
List every key path in a JSON document with value type and count, in dot, bracket, or JSONPath form.
Open tool
DeveloperJSON Flatten Unflatten
Two-way converter between nested JSON and path-keyed flat JSON.
Open tool
DeveloperJSON Sort Keys
Sort keys in any JSON object. Deep or top-level, A to Z or Z to A, with natural order support.
Open tool
TextFind and Replace
Find and replace text in plain or regex mode with live match highlighting.
Open tool