jsontoolskit.org
JSON and JSON Schema utilities, in the browser
Say hi →

Rename JSON Keys

bulk rename by list or regex · drop unwanted keys · updated 28 July 2026

Rename keys throughout a JSON document. Give a mapping list (old -> new, one per line), or a regular expression applied to every key name, and list any keys you want removed entirely. Renames recurse through nested objects and arrays.

Paste input to start.

How to rename keys in a JSON document

  1. Paste your JSON.
  2. Write your renames in the Mapping box, one per line. ->, =>, = and : all work as the separator.
  3. List keys to remove in Drop these keys — useful for stripping internal or debug fields before sharing a payload.
  4. For pattern work, use the regex field: ^prefix_ with an empty replacement strips a prefix from every key. Capture groups are available as $1.
  5. Copy or download the result. The status bar counts renames and drops.

Mapping wins over regex

When a key appears in the mapping list, that rename is used and the regex is not applied to it. This lets you write one broad pattern plus a handful of explicit exceptions, which is usually how real renames go.

Renaming a key to an empty string removes it, which is another way to drop keys if that reads better for your case. Every rename applies at every depth — there is currently no way to limit a rename to one level.

Related tools for key work

For a whole-document convention change, Convert key case is a better fit than writing out every rename. To see which keys exist before deciding, Stats lists the most repeated keys and List all paths shows every one with its type.

Privacy

Nothing is uploaded. The conversion runs in this tab using your own browser's JavaScript engine — no server sees your data, and the page keeps working with the network disconnected.

FAQ

What if two keys end up with the same name?

The later one overwrites the earlier — JSON objects cannot hold duplicates. Unlike the case converter, this tool does not warn about it, so check the output when your mapping could produce a clash.

Can I rename a nested key only at one path?

Not with this tool — renames are name-based and apply at every depth. For path-specific surgery, generate an RFC 6902 patch with move operations.

Do the keys inside arrays get renamed?

Yes. Arrays are traversed and every object inside them is processed, at any depth.