Micro Tool Yard logo
Tools

Your input wasn't valid JSON — it was automatically repaired. Review what changed below before using the result.

{"name":"micro-tool-yard","tools":["pdf","image","json",],
version: 1}
+ {"name":"micro-tool-yard","tools":["pdf","image","json"],
+ "version": 1}

Pretty-printed

{
  "name": "micro-tool-yard",
  "tools": [
    "pdf",
    "image",
    "json"
  ],
  "version": 1
}

Tree view

name:"micro-tool-yard"
"pdf"
"image"
"json"
]
version:1
}
Minified output
{"name":"micro-tool-yard","tools":["pdf","image","json"],"version":1}
Validate against a JSON Schema (optional)
Ad Slot

How it works

  1. Paste or load your JSON

    Paste directly, or load a .json file from your device.

  2. Invalid JSON gets auto-repaired

    Trailing commas, single quotes, and unquoted keys are fixed automatically, with a diff of exactly what changed.

  3. Pretty-print, minify, or sort keys

    Switch indent width, sort object keys alphabetically, or collapse to a single line.

  4. 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.


FAQ

What counts as "malformed" JSON that gets auto-repaired?
Common non-standard patterns: trailing commas, single-quoted strings, unquoted object keys, JavaScript-style comments, and JS-only values like undefined or NaN. These are typical when JSON is hand-edited or copied from JavaScript source.
How do I know what was changed during repair?
When your input needed repair, a diff view appears showing exactly which lines were added or changed during the fix — nothing is corrected silently.
What does "Sort keys" do?
It recursively sorts every object's keys alphabetically, which is useful for diffing JSON files or normalizing config output.
Is my JSON data uploaded anywhere?
No. Parsing, repair, formatting, and schema validation all happen locally in your browser.