Skip to content

JSON Transformer

Flatten JSON — Convert Nested Objects to Paths

Turn nested JSON objects and arrays into a compact path-to-value object with a separator you choose.

100% In-Browser & PrivateNo uploadsFree forever

Flatten nested JSON into a single object whose keys are paths and whose values are the original leaf values. By default, a dot separates object keys and array indexes, so `user.profile.name` and `scores.0` identify nested values.

Arrays use numeric path segments and empty objects or arrays stay as values. Keys containing the separator are escaped with a backslash; numeric object keys are escaped too so they remain distinct from array indexes and can be unflattened without changing type.

Choose another separator when your data uses dots in property names. Conversion runs locally in a Web Worker; no JSON is uploaded.

Nested JSON flattened to paths

{
  "user": { "profile": { "name": "Ada" } }
}

→

{
  "user.profile.name": "Ada"
}

How to flatten JSON

  1. 1Paste a JSON object or array, or load the sample.
  2. 2Set the path separator if your property names contain the default dot.
  3. 3Select Flatten JSON to produce a path-to-value object.
  4. 4Copy or download the result. Use the Unflatten JSON page to restore the nested structure.

Why MyJSONPal is different

Privacy-first, by design

All parsing, validation and conversion runs in your browser. Your data is never sent, logged, cached or sold — close the tab and it is gone.

Fast, even on huge files

Heavy processing is offloaded to a Web Worker, so multi-megabyte documents are handled without freezing the interface.

No accounts, no limits

There is nothing to sign up for and no usage quota. Paste, format, convert and download as often as you like.

Frequently asked questions

How are arrays flattened?

Array indexes become numeric path segments. For example, `items[0].id` is represented as `items.0.id` with the default dot separator.

What happens when an object key contains the separator?

The separator is escaped with a backslash in that path segment, so flattening and unflattening preserve the original key.

Are numeric object keys confused with array indexes?

No. Numeric object keys are escaped in the flattened path; unescaped numeric segments are reserved for array indexes.

Are empty objects and arrays preserved?

Yes. An empty object or array is kept as a value at its parent path instead of disappearing.

Is my JSON uploaded?

No. Parsing and transformation run locally in your browser using a Web Worker.