About this tool
JSON Flatten / Unflatten is a free, in-browser tool that converts nested JSON into a single-level map of dot-notation keys, and rebuilds the nested structure back from those flat keys. Paste JSON and choose a direction: Flatten collapses every path into one flat object (for example user.name or user.roles.0), while Unflatten expands dotted keys back into nested objects and arrays.
Both directions parse your input with the browser's own JSON parser and pretty-print the result with two-space indentation. Objects and arrays are walked recursively, array items keep their numeric index in the path, and leaf values — strings, numbers, booleans, null, and empty objects or arrays — are preserved unchanged. Invalid JSON shows an inline error instead of output, and a copy button puts the result on your clipboard.
Everything runs locally in JavaScript: no uploads, no accounts, no tracking, and it works offline. Flattening is handy for turning config into flat key/value pairs such as environment variables or i18n message files, for diffing deeply nested payloads, or for reshaping API responses, and unflattening reverses the same mapping.