{ }jsonkit
Format
Validate
Convert
Query
Generate
{+}

JSON Repair & Fixer for Invalid JSON Online

Fix common syntax mistakes and return clean, valid JSON locally.
Indent
131 B · paste or drop a file
1 2 3 4 5 6 7
✓ complete131 B → 70 B0.0 ms

About JSON Repair

The JSON Repair tool turns many common almost-JSON documents into strict, readable JSON. It handles mistakes that often appear in copied configuration, JavaScript object literals and hand-edited API fixtures: comments, trailing commas, single-quoted strings, unquoted keys and non-JSON literals such as undefined, NaN or Python-style booleans.

Repair happens entirely inside your browser. The input is treated as text and is never evaluated as JavaScript, so object constructors and executable expressions are not run. Your payload is not uploaded, which makes the tool practical for logs, development fixtures and internal responses that should stay on your device.

The repair process is intentionally conservative. It applies a defined set of transformations and then passes the result through the native strict JSON parser. If the result is still ambiguous or incomplete, the tool reports the remaining syntax problem instead of guessing at a structure that could change the meaning of your data.

How it works

Normalize common JSONC and object-literal syntax

Line and block comments are removed without touching comment-like text inside strings. Single-quoted strings are converted to JSON strings, ordinary bare object keys are quoted, and trailing commas before closing braces or brackets are removed.

Repair familiar non-JSON literals

Values such as undefined, NaN, Infinity and None become null, while common Python boolean spellings become JSON booleans. These conversions are useful for copied debug output, but you should review null replacements because they cannot preserve a non-finite numeric value.

Validate and format the repaired result

After the text passes are complete, the browser parses the result as strict JSON and serializes it with your chosen indentation. That final parse is the safety gate: output is only shown when it is valid JSON.

Know when a manual decision is required

Severely truncated documents, expressions, computed properties and ambiguous punctuation are not reconstructed automatically. The remaining parser message points to the place where a human decision is still needed.

Frequently asked questions

What kinds of invalid JSON can this tool repair?

It repairs comments, trailing commas, single quotes, unquoted conventional keys, code fences, some missing line-ending commas and several common non-JSON literals. It does not promise to recover every damaged document.

Does JSON Repair execute JavaScript?

No. It uses text transformations followed by JSON.parse. Functions, constructors and expressions are never evaluated.

Why was NaN or undefined changed to null?

Strict JSON cannot represent either value. Null is the explicit JSON placeholder used by this repairer, so review those fields if the distinction matters to your application.

What should I do if automatic repair fails?

Use the reported error location to resolve the ambiguous part manually. A truncated string, unmatched bracket or executable expression usually needs context that an automatic repair pass cannot infer safely.