Minify · Beautify · Flatten · Sort · Merge · Diff — all free

JSON Utilities
Minify, flatten, sort,
merge and diff.

Five essential JSON tools in one place. Minify and beautify, flatten nested objects, sort keys, deep-merge two objects and compare JSON diffs. Everything runs in your browser — no upload, no account.

Your data never leaves your browser
Minify + Beautify
Flatten + Unflatten
Diff + Merge + Sort
Always free
JSON Minifier & Beautifier   100% client-side
JSON input
  Ready

        

JSON Minifier — remove whitespace and compress JSON

Minifying JSON removes all unnecessary whitespace, newlines and indentation to produce the most compact valid JSON string. This is useful for API responses, localStorage storage and network payloads where every byte counts.

How to minify JSON

Paste your JSON above and click Minify. The tool calls JSON.stringify(obj) without indentation — the most compact valid output. Typical compression is 20–40% for well-indented JSON files. The minified output is valid JSON that any parser will accept.

How to minify JSON in JavaScript

JSON.stringify(JSON.parse(jsonString)) — parse then re-stringify without an indent argument. In Node.js: const min = JSON.stringify(JSON.parse(fs.readFileSync('data.json', 'utf8'))). In Python: json.dumps(json.loads(s), separators=(',', ':')).

JSON Beautifier — pretty-print and format JSON

Beautifying (pretty-printing) JSON adds indentation and newlines to make it human-readable. Click Beautify and choose 2-space, 4-space or tab indentation. This is the reverse of minification — takes compact or malformatted JSON and outputs clean, readable JSON.

JSON formatter online

Paste any valid JSON — minified, single-line or malformatted — and click Beautify to get a properly indented, human-readable version. Useful when working with API responses from curl, Postman or browser DevTools that arrive as a single line.

JSON pretty print in Python

print(json.dumps(data, indent=2)) — the indent parameter controls the spaces per level. To write to file: json.dump(data, f, indent=2). For consistent key order add sort_keys=True.

JSON Flatten & Unflatten   100% client-side
JSON input
  Ready

        

JSON Flatten — convert nested JSON to flat key paths

Flattening JSON converts a deeply nested object into a flat dictionary where nested keys are joined by a separator (dot by default). This is useful for databases that don't support nested documents, CSV exports and environment variable generation.

How to flatten nested JSON

Paste your nested JSON and click Flatten. {"user":{"name":"Alice"}} becomes {"user.name":"Alice"}. Arrays are preserved with index notation: {"tags.0":"admin","tags.1":"user"}. Choose the separator (dot, underscore or slash) to match your target system.

JSON Unflatten — reconstruct nested JSON

Paste a flat JSON object (with dotted keys) and click Unflatten to reconstruct the original nested structure. {"user.name":"Alice","user.city":"London"} becomes {"user":{"name":"Alice","city":"London"}}.

How to flatten JSON in Python and JavaScript

In Python use pd.json_normalize(data) from pandas, or the flatten-dict package. In JavaScript: flat.flatten(obj) from the flat npm package. This online tool requires no installation.

JSON Sort Keys   100% client-side
JSON input
  Sorted

        

JSON Sort Keys — sort JSON object keys alphabetically

Sorting JSON keys produces consistent, deterministic output regardless of insertion order. This is useful for version control diffs (sorted keys produce cleaner git diffs), canonical JSON generation and comparing two objects that may have the same keys in different order.

How to sort JSON keys

Paste your JSON and click Sort A→Z. All object keys at every level of nesting are sorted alphabetically. Array order is preserved — sorting only applies to object keys, not array elements. The result is semantically identical JSON with deterministic key ordering.

How to sort JSON in Python

json.dumps(data, sort_keys=True, indent=2) — the sort_keys=True parameter sorts all object keys recursively. In JavaScript: JSON.parse(JSON.stringify(obj, Object.keys(obj).sort())) for shallow, or a recursive implementation for deep sorting.

JSON Merge — deep merge two JSON objects   100% client-side
Object A (base)
Object B (overrides)
  Merged

        

JSON Merge — deep merge two or more JSON objects

Merging JSON objects combines their properties. Deep merge recursively merges nested objects — if both A and B have a settings object, their keys are merged rather than B's settings overwriting A's entirely. Shallow merge uses Object.assign semantics where B overwrites A at the top level.

Deep merge vs shallow merge

Deep merge: A={a:{x:1,y:2}} + B={a:{y:3,z:4}}{a:{x:1,y:3,z:4}}. Nested object keys are merged, not replaced. Shallow merge: {a:{y:3,z:4}} — B's a replaces A's a entirely.

How to merge JSON objects in JavaScript

Shallow: Object.assign({}, a, b) or {...a, ...b}. Deep: structuredClone + recursive merge, or lodash.merge(a, b). In Python: a | b (Python 3.9+) for shallow, or a recursive function for deep.

JSON Diff — compare two JSON objects   100% client-side
JSON A (original)
JSON B (modified)
  Diff ready

JSON Diff — compare two JSON objects and find differences

JSON diff compares two JSON objects and shows what was added, removed or changed. Added keys appear in green, removed keys in red, and changed values show both the old and new value. Useful for debugging API response changes, comparing config files and reviewing data migrations.

How to compare two JSON objects

Paste JSON A (original) and JSON B (modified) into the panels above and click Compare. The diff highlights every change: green for additions, red for removals, yellow for changed values. Nested changes are shown at the exact path where they occur.

How to compare JSON in JavaScript

JSON.stringify(a) === JSON.stringify(b) for equality only. For a proper diff use jsondiffpatch or the deep-diff package. In Python: deepdiff.DeepDiff(a, b) from the deepdiff package.

Popular searches
json minify json beautify json formatter online how to minify json json pretty print flatten json nested json to flat json json unflatten json sort keys how to sort json json merge how to merge json files json deep merge json diff json compare how to compare json files
Go up