Flatten nested JSON to dot-notation keys and unflatten it back — choose the delimiter and array style, types preserved, browser-only.
- Runs locally
- Category Developer & DevOps
- Best for Formatting, validating, shrinking, or inspecting code-adjacent text.
✓ Valid JSON in
{
"a.b": 1,
"tags.0": "x",
"tags.1": "y",
"ok": true
}What this tool does
Flatten nested JSON into single-level dot-notation keys, and unflatten flat keys back into the original nested object. Paste any JSON: a nested object like {"a":{"b":1}} becomes {"a.b":1}, and the reverse rebuilds the tree exactly. Pick how arrays are written — numeric keys (a.0) or bracket indices (a[0]) — and choose the delimiter (dot, underscore, or a custom separator) so a literal dot in your keys never collides with a level boundary. Every leaf keeps its JSON type: numbers stay numbers, booleans stay booleans, null stays null. Invalid JSON gets a friendly error with the line and column. One-click copy, indented output, and a shareable URL that reproduces your exact input and options. 100% client-side, nothing uploaded.
Tool details
- Input
- Text + Numbers + Structured content
- The page exposes text boxes, numeric controls, file pickers, or structured inputs depending on the tool.
- Output
- Live result + Copy
- The result area focuses on usable output, with copy, download, or preview actions when supported.
- Privacy
- Browser-side processing
- The main tool logic does not call an external API, so inputs normally stay in the current tab.
- Save / share
- Shareable URL state
- Key settings are encoded in the URL so another person can reopen the same setup.
- Performance budget
- Initial JS <= 9 KB
- No WASM budget is declared, keeping the tool quick to open on mobile.
- Best fit
- Developer & DevOps · Developer
- Category and role tags drive related tools, internal links, and quick fit checks.
How to use
-
1. Input
Paste or drop your content into the tool panel.
-
2. Process
Click the button. All processing is local in your browser.
-
3. Copy / Download
Copy the result or download to disk in one click.
How JSON Flatten / Unflatten fits into your work
Use it in the small gaps between coding, reviewing, debugging, and shipping.
Developer jobs
- Formatting, validating, shrinking, or inspecting code-adjacent text.
- Preparing snippets for documentation, tickets, commits, or handoff.
- Checking a small payload quickly without switching tools.
Developer checks
- Run irreversible transforms like minify or obfuscate on a copy.
- Keep secrets out of pasted snippets unless the tool explicitly stays local.
- Use your normal tests or linter before shipping transformed code.
Good next steps
These links move the current task into a more complete workflow.
- 1 JSON Formatter & Validator Format, validate, and minify JSON instantly — right in your browser. Open
- 2 JSON Diff Structural JSON compare — added / removed / changed keys by path, three-colour tree, browser-only Open
- 3 JSON to CSV Converter Turn a JSON array (or object) into clean CSV — flattens nested keys, escapes per RFC 4180, custom delimiter, UTF-8 BOM for Excel — browser-only Open
Real-world use cases
Load nested config into a flat .env or key-value store
Your app config lives as nested JSON, but the deploy target wants flat keys: Consul, etcd, a .env file, or AWS Parameter Store. Paste {"db":{"host":"localhost","port":5432}}, flatten it, and you get db.host and db.port as top-level keys you can write straight to the store. Pick the underscore delimiter and DB_HOST / DB_PORT drops into an env file without another rename pass.
Diff two configs that differ three levels down
Two service configs look identical at a glance but one request fails in staging. Flatten both, paste the flat versions into a diff tool, and the one line that changed shows up as a single key like features.checkout.retryLimit instead of being buried inside three nested braces you have to expand by eye.
Map an i18n translation tree to flat message keys
Translation files are nested by namespace: {"home":{"title":"Hi"}}. Most translation platforms and gettext-style catalogs want flat keys like home.title. Flatten the tree, hand the flat list to translators, and unflatten their returned file back into the nested shape your i18n library loads. Round-trips cleanly with no manual key rebuilding.
Turn a JSON object into spreadsheet-friendly columns
You want one nested record as a single spreadsheet row. Flatten it so every leaf becomes one column header (address.city, address.zip, tags.0, tags.1), paste into your sheet, and the structure that JSON encoded as nesting becomes plain columns. Switch array style to a[0] if your import expects bracket indices instead of numeric dot keys.
Common pitfalls
Picking a delimiter that already appears in your keys. If a key is "user.name" and you flatten with ".", unflatten can no longer tell the literal dot from a level boundary. When keys contain dots, switch to "_" or a custom delimiter that never shows up in your data.
Expecting unflatten to keep your custom array style automatically. Flatten with a[0] but unflatten with the a.0 setting and the numeric segments rebuild as object keys, not an array. Use the same delimiter and array-bracket option on both directions, or the round-trip silently changes shape.
Assuming numbers and booleans become strings. They do not — flatten preserves the JSON type of every leaf, so 5432 stays a number and true stays a boolean. If you need everything stringified for a key-value store that only accepts strings, do that conversion after flattening, not before.
Privacy
Flatten, unflatten and JSON parsing all run as plain JavaScript inside your browser tab — JSON.parse plus a small recursive walk over the object. No JSON ever uploads, nothing is logged, and there is no network request carrying your data. The one thing that leaves the page: the shareable URL encodes your input and options in the query string, so a link pasted into chat records that payload in the recipient server's access log. For confidential config or secrets, use the copy button and paste the text instead of sharing the URL.
FAQ
Tool combos
Folks in your role tend to reach for these alongside this tool.
- Add Line Numbers Number every line of pasted text — set start, step and separator, zero-pad to align, skip blanks, or strip numbers back off — browser-only
- AES Text Encryptor Encrypt & decrypt text with a password — AES-256-GCM + PBKDF2 via WebCrypto — 100% in your browser, nothing uploaded
- Age Difference Calculator The exact gap between two birthdays — years/months/days, percentage, and the date one person is twice the other's age — browser-only
- AI Model Comparison AI model comparison — 20+ models (GPT / Claude / Gemini / Llama / Qwen) across price, context, speed, capabilities (2026).