JSON Formatter & Diff
Prettify, minify, and diff JSON or JSONC online, or convert it to YAML — entirely in your browser.
About this tool
Format mode pretty-prints or minifies JSON with syntax highlighting, and can output YAML instead — handy when moving config between formats. Input accepts JSONC: comments and trailing commas are stripped before parsing, so you can paste tsconfig.json or VS Code settings directly.
Diff mode compares two documents structurally: both sides are parsed and then compared value-by-value, so key order, whitespace, and comments never count as differences. Each change is reported with a JSONPath-style location.
Frequently asked questions
What is JSONC?+
JSON with Comments — standard JSON plus // and /* */ comments and trailing commas. Used by tsconfig.json, VS Code settings, and many dev tools. Strict JSON.parse rejects it; this tool strips the extensions first.
How is structural diff different from text diff?+
A text diff compares lines, so reordered keys or re-indented files look completely changed. A structural diff compares the parsed data, so only actual value changes are reported — what you usually want for config and API payloads.
Is my JSON sent to a server?+
No. Parsing, formatting, conversion, and diffing all run in your browser. Inputs are saved only to your own localStorage so they survive a refresh.
Does converting to YAML lose anything?+
The data converts losslessly, but JSONC comments are dropped (they are stripped during parsing) and key order is preserved as-is. Watch out for YAML consumers that re-interpret strings like 'no' or '012' — quote them if in doubt.
Can I paste escaped JSON copied from logs?+
Yes. Input like {\"a\":1} (escaped quotes, with or without outer quotes) is unescaped automatically. Turn on "Deep parse nested JSON" to also expand JSON documents embedded as string values — SQS message bodies, event.body, stringified payloads in error logs — back into real structures.