Your input wasn't valid JSON — it was automatically repaired. Review what changed below before using the result.
Pretty-printed
{
"name": "micro-tool-yard",
"tools": [
"pdf",
"image",
"json"
],
"version": 1
}Tree view
Minified output
{"name":"micro-tool-yard","tools":["pdf","image","json"],"version":1}Validate against a JSON Schema (optional)
How it works
Paste or load your JSON
Paste directly, or load a .json file from your device.
Invalid JSON gets auto-repaired
Trailing commas, single quotes, and unquoted keys are fixed automatically, with a diff of exactly what changed.
Pretty-print, minify, or sort keys
Switch indent width, sort object keys alphabetically, or collapse to a single line.
Optionally validate against a schema
Paste a JSON Schema to check your data against it, with actionable error messages.
JSON Formatter / Corrector pretty-prints, minifies, and validates JSON, and automatically repairs common malformed-JSON patterns — trailing commas, single-quoted strings, unquoted keys, and JavaScript-style comments — that a strict JSON.parse rejects outright. When repair is needed, you see exactly what changed before relying on the result, so nothing is corrected silently.
Successfully parsed JSON renders as both a pretty-printed text view and an interactive collapsible tree, and you can optionally paste a JSON Schema to validate your data against it, with specific, actionable error messages for anything that doesn't match. Every step runs locally in your browser.
The auto-repair step exists because "invalid JSON" is often just JavaScript that was copy-pasted somewhere expecting strict JSON — a config object with unquoted keys, a trailing comma left over from editing an array, single quotes instead of the double quotes JSON requires. A plain JSON.parse rejects all of these outright with a generic syntax error and a character position, which is technically correct but not always helpful when you just want the data usable. The repair pass recognizes these specific, well-understood non-standard patterns and fixes them automatically, then shows a line-by-line diff of exactly what it changed — the same visibility principle used throughout this site: automatic fixes are fine, silent ones aren't.
The optional schema-validation step uses standard JSON Schema (the same specification covered in the JSON Schema basics guide), so any schema you already have from an API spec or a project's config validation can be pasted in directly rather than needing to be rewritten for this tool specifically. Validation errors report exactly which property failed and why, so you can fix the data at its source instead of guessing which of several possible constraints tripped.
Sorting keys alphabetically is a small feature with an outsized practical use: two JSON documents that represent the same data but were generated in different key orders will show as completely different in a naive text diff. Sorting both through this tool first normalizes that ordering, so a subsequent diff reflects only genuine data changes.