JSON Key Renamer
JSON Key Renamer / Mapper
The JSON Key Renamer (also known as a key mapper) lets you rename JSON keys quickly and consistently. It is ideal for transforming API payloads, aligning data with database schemas, or adapting third-party JSON to your internal naming conventions. Use simple mappings like user.name=fullName to rename fields, including nested keys with dot notation. The tool runs locally in your browser to keep your data private.
Renaming keys is a common step when integrating multiple systems. One API may return user_name, while another expects userName. By mapping keys in one pass, you keep data consistent and reduce manual editing. This tool helps you standardize output quickly, which is especially valuable for data pipelines, ETL jobs, and front-end integrations.
What the key renamer does
- Renames keys based on your mapping rules.
- Supports nested keys with dot notation.
- Keeps values unchanged while adjusting field names.
- Outputs valid JSON for immediate use.
How to use the key renamer
- Paste JSON into the left editor.
- Add mapping rules in the mapper field, one per line.
- Click Rename to generate the output.
- Copy or download the renamed JSON.
Example: simple key renaming
Input JSON:
{
"id": 10,
"user_name": "Avi",
"is_active": true
}
Mapping rules:
user_name=userName
is_active=active
Output JSON:
{
"id": 10,
"userName": "Avi",
"active": true
}
Example: nested keys with dot notation
Input JSON:
{
"user": {
"name": "Avi",
"contact": { "email": "avi@example.com" }
}
}
Mapping rules:
user.name=fullName
user.contact.email=emailAddress
Output JSON:
{
"user": {
"fullName": "Avi",
"contact": { "emailAddress": "avi@example.com" }
}
}
Common errors and fixes
- Invalid JSON: Renaming requires valid JSON. Use JSON Validator to fix syntax errors.
- Mapping not applied: If a key doesn’t change, confirm the path is correct and matches the JSON structure.
- Collision conflicts: Renaming two keys to the same target can overwrite values. Use distinct target names.
- Nested path issues: If the path is incorrect, the tool cannot find the key. Verify the full dot path.
- Array handling: Paths with arrays may require indexes (e.g.,
items.0.name). Flatten first if needed.
Best practices for key mapping
- Plan naming conventions before mapping (camelCase, snake_case, etc.).
- Use consistent target names to avoid confusion.
- Test mappings with small samples before applying to large payloads.
- Combine with JSON Remove Keys to clean unnecessary fields.
- Use JSON Flatten if you need to map very deep structures.
Mapping strategies
There are two common approaches to key mapping: normalize everything to a single style (e.g., camelCase) or map to a target schema (e.g., database column names). For normalization, use a consistent rule set so keys remain predictable. For schema mapping, document the mapping rules so they can be reused in scripts or pipelines.
If you need to map multiple sources to one unified schema, create a separate mapping file for each source. This keeps transformations clear and avoids accidental conflicts.
Edge cases to watch
- Duplicate targets: Two mappings pointing to the same output key can overwrite values.
- Reserved words: Keys like
classordefaultmay be problematic in some languages. - Arrays: Use index paths when renaming keys inside arrays, or flatten first.
- Mixed casing: Inconsistent input casing can cause missed matches.
Automation tips
If you repeatedly rename the same fields, save your mapping list in a shared document or repository. This allows teammates to apply the same mappings in scripts and ensures consistency across environments. For data pipelines, treat the mapping list as configuration and version it alongside your ETL code.
You can also combine renaming with filtering: remove unused fields first, then rename the remaining keys for cleaner output.
Workflow checklist
- Validate input JSON.
- Define mapping rules and verify target names.
- Run rename and inspect output.
- Apply additional cleaning if needed.
Case conversion notes
If your main goal is to change naming style (snake_case to camelCase, etc.), define mappings for key groups or run a pre-processing step to convert case automatically, then use this tool for the remaining exceptions. This keeps your mapping list smaller and easier to maintain.
When renaming keys for code generation, align keys with your model classes and DTOs. Consistent naming reduces friction across front-end and back-end teams.
For legacy systems, keep a mapping table that documents the old-to-new field names. This prevents confusion during migrations and supports backward compatibility.
Use cases
API integration: Rename keys to match your internal DTOs.
Database inserts: Align JSON keys with database column names.
ETL pipelines: Normalize inconsistent field naming from multiple sources.
Frontend development: Convert API outputs to UI-friendly naming conventions.
FAQs
Does renaming change my values?
No. Only keys are renamed; values remain the same.
Can I rename nested keys?
Yes. Use dot notation such as user.profile.email=emailAddress.
Is my JSON uploaded?
No. Everything happens locally in your browser.
What if a key doesn’t exist?
The mapping is skipped. Verify the path is correct.
Can I rename keys inside arrays?
Yes, but you may need index-based paths or flatten the JSON first.
How do I handle multiple renames at once?
Add one mapping per line in the mapper field.
Can I combine this with CSV conversion?
Yes. Rename keys first, then use JSON to CSV.
Does this support reverse mapping?
You can reverse the mapping rules and run again to restore original names.
Can I rename keys in multiple files?
Yes. Apply the same mapping rules to each file for consistent output.
What if I need bulk renaming?
Create a mapping list and reuse it; the tool applies all mappings in one pass.
Can I use this for API versioning?
Yes. Map old field names to new ones to maintain backward compatibility.
Does it rename keys in nested arrays?
It can, but you may need index-based paths or to flatten first.
Is there a limit to mapping lines?
There is no strict limit, but extremely large mapping lists can be slower in the browser.
How do I avoid typos in mappings?
Copy paths directly from a formatted JSON view to reduce mistakes.
Keyword‑targeted phrases
- json key mapper
- map json keys
- json rename online
- rename json fields
- rename json keys online
Related tools: JSON Formatter, JSON Remove Keys, JSON Flatten, JSON to CSV