ETEvoraTools
JSON Tools

JSON Unflattener

JSON Unflattener expects a top-level JSON object, splits every key at literal dots, creates intermediate objects, and assigns the value at the final segment. It does not rebuild arrays, unescape dots, detect conflicting paths, or guard the path grammar as a security boundary. Values such as a and a.b can conflict, dotted original keys cannot be recovered, and untrusted special property names should not be treated as safe application objects.

Runs locally — files stay on your device
Quick answer

Can it recreate arrays from keys like items.0?

No. It creates objects with string keys such as "0".

Path expansion requires conflict rules

When one key names both a value and a parent path, an unflattening system must define precedence or reject the conflict. This implementation has no explicit policy.

How it works

Each key is split by period; missing intermediate segments receive plain objects; the last segment receives the original value.

Key concepts

All containers are objects

Numeric segments do not create arrays.

Order can affect conflicts

Earlier assignments can be replaced or cause failures.

When to use it

  • Expand simple dot paths with no conflicts.
  • Rebuild ordinary nested configuration objects.
  • Reverse this flattener for a constrained dataset.

When not to use it

  • Do not process adversarial path keys.
  • Do not expect arrays or escaped dots.
  • Do not use conflicting parent and child paths.

Worked examples

Simple path

Input
{"user.name":"Ana"}
Expected output
{"user":{"name":"Ana"}}

One intermediate object is created.

Numeric path

Input
{"items.0":"a"}
Expected output
{"items":{"0":"a"}}

No array inference.

Conflict

Input
{"a":1,"a.b":2}
Expected output
Unreliable/error

a cannot safely be both primitive and object.

Common mistakes

Expecting arrays

Only objects are created. Correction: Use a schema-aware expander.

Using dotted literal keys

Dots always mean nesting. Correction: Use an escaping convention.

Accepting untrusted paths

Special names can interact with object semantics. Correction: Validate segments against an allowlist.

Best practices

  • Validate every path segment.
  • Reject parent/child conflicts.
  • Keep an original and test round trips.

Related operations and differences

CSV to JSON

Choose CSV to JSON when you need to convert a header-based CSV table to JSON.; use JSON Unflattener specifically for json unflatten.

Extract JSON Values

Choose Extract JSON Values when you need to list every primitive value in a JSON document.; use JSON Unflattener specifically for json unflatten.

JSON Beautifier

Choose JSON Beautifier when you need to format JSON with readable indentation.; use JSON Unflattener specifically for json unflatten.

JSON Flattener

Choose JSON Flattener when you need to flatten nested objects into dot paths.; use JSON Unflattener specifically for json unflatten.

JSON Key Sorter

Choose JSON Key Sorter when you need to sort object keys recursively.; use JSON Unflattener specifically for json unflatten.

JSON Minifier

Choose JSON Minifier when you need to remove unnecessary JSON whitespace.; use JSON Unflattener specifically for json unflatten.

Limitations and privacy

  • Plain object paths only.
  • No arrays, dot escaping, conflict detection, safe-key allowlist, schema, or guaranteed inverse.
  • Top-level nonobjects are unsuitable.

Input is processed locally in this browser and is not uploaded by the tool.

Frequently asked questions

Are arrays rebuilt?

No.

Can a key contain a literal dot?

Not without being interpreted as nesting.

Are conflicts reported clearly?

No explicit conflict validator exists.

Should untrusted keys be accepted?

No, validate them first.