Reversible paths
Use one explicit root marker and distinct object and array notation for reliable reconstruction.
Start typing to search 227 tools.
Flatten nested JSON objects and arrays into reversible $-rooted path-value pairs while preserving empty objects, empty arrays, scalar types, and array indexes.
JSON Flatten converts a nested JSON document into a flat JSON object whose property names describe the original location of every value. All paths begin with $. Object properties use the selected dot or slash separator, while arrays use explicit indexes such as [0].
The output is designed to be reversible with Trexmi JSON Unflatten. Empty objects and arrays are kept as values instead of disappearing. A backslash escapes a separator or bracket that belongs to an actual property name. This path syntax is a Trexmi interchange convention, not JSONPath or JSON Pointer.
$.order.id; slash mode produces $/order/id.[0], [1], and later indexes.Focused controls, predictable output, and a workflow designed around this exact transformation.
Use one explicit root marker and distinct object and array notation for reliable reconstruction.
Preserve empty objects, empty arrays, null, booleans, numbers, and strings.
Keep keys that contain dots, slashes, brackets, or backslashes without path ambiguity.
Inspect deeply nested payloads as a compact list of locations and typed values.
Practical details about input, output, privacy, limits, and the best way to use this tool.
It outputs one JSON object. Each property name is a $-rooted path and each property value is the JSON value stored at that location.
Arrays use zero-based bracket indexes. For example, the first item name is represented as $.items[0].name in dot mode.
Yes. An empty container is stored directly at its path so JSON Unflatten can recreate it.
The selected separator is escaped with a backslash. Brackets and backslashes inside property names are escaped as well.
No. It resembles familiar path notation but is a reversible Trexmi flat-map format. Do not pass these keys directly to a JSONPath engine.
Yes. A root array begins with paths such as $[0]. A root scalar or empty root container is stored under the exact $ path.
The generated map follows the parsed source order, but JSON object member order should not be used as application logic. Array order is preserved by indexes.
No. It exposes paths and values but does not rename fields, join datasets, validate a business schema, or guarantee compatibility with a destination database.
Learn JSON objects, arrays, value types, validation, formatting, parsing, API workflows, and common syntax errors.
Object properties become dot-separated paths and each JSON scalar keeps its type.
{"order":{"id":1042,"customer":{"name":"Ada"},"paid":true}}
{"$.order.id":1042,"$.order.customer.name":"Ada","$.order.paid":true}
Bracket indexes preserve array order separately from object property names.
{"items":[{"sku":"A-1","qty":2},{"sku":"B-7","qty":1}]}
{"$.items[0].sku":"A-1","$.items[0].qty":2,"$.items[1].sku":"B-7","$.items[1].qty":1}
Empty objects and arrays are leaves because otherwise their existence would be lost.
{"filters":{},"results":[],"next":null}
{"$.filters":{},"$.results":[],"$.next":null}
The doubled JSON backslash represents one path escape: the first dot is data and the next dot is the object separator.
{"release.version":{"major":2}}
{"$.release\\.version.major":2}
The root marker is $. In dot mode, an object property is appended as .property; in slash mode it is appended as /property. An array position is always appended as [index]. Keeping array notation independent from the object separator lets the reverse operation distinguish an object property named 0 from array index zero.
The flat output remains valid JSON. Values are not converted to display strings: true remains a boolean, null remains null, and numbers remain JSON numbers as supported by the server parser.
A normal leaf is a string, number, boolean, or null. Empty objects and arrays are also treated as leaves because there are no children from which JSON Unflatten could infer their existence. Non-empty arrays create one path for every indexed descendant.
Use JSON Unflatten with the same separator to test reversibility. Use JSON Formatter first when the input is hard to read, or JSON Path Finder when the goal is searching rather than transformation.
A property separator, opening or closing bracket, or literal backslash is escaped with a preceding backslash. For example, the key release.version becomes release\.version in dot mode. The escape belongs to the flat path only; the original key is restored without it.
Do not edit escaped paths casually. Removing one backslash can change a single property name into two nested properties.
Flattening is a structural transformation, not schema validation. It cannot determine required fields, normalize dates, resolve references, detect duplicate object member names already collapsed by a JSON parser, or map values to SQL columns. Very deep or very large documents remain subject to server input and JSON nesting limits.
JSON itself defines objects, arrays, numbers, strings, booleans, and null, but it does not define a universal flattening syntax. Read RFC 8259 for JSON interoperability rules. For a standardized single-location syntax with different escaping rules, compare JSON Pointer RFC 6901.
After verifying the flat map, reconstruct it with JSON Unflatten or export suitable records through JSON to CSV.