# JSON Repair

> Fix broken JSON: trailing commas, comments, single quotes, missing brackets and more. Runs entirely in your browser, so nothing is uploaded.

Source: https://toffeekit.com/tools/json-repair

**Category:** [Developer](https://toffeekit.com/category/developer) · **Price:** Free · **Runs:** in your browser, nothing is uploaded

Open the tool: https://toffeekit.com/tools/json-repair

**Also useful for:** fix json, repair json, invalid json, json fixer, trailing comma, json5 to json, unquoted keys, llm json

## What you can do

- **Fix and format** — Repair the JSON and indent it so it's easy to read. ([open with this preset](https://toffeekit.com/tools/json-repair?preset=pretty))
- **Fix and minify** — Repair, then strip all spaces for a compact payload. ([open with this preset](https://toffeekit.com/tools/json-repair?preset=minify))
- **Keep my layout** — Fix only what's broken and leave your line breaks alone. ([open with this preset](https://toffeekit.com/tools/json-repair?preset=keep))

## How it works

1. Paste broken JSON into the left panel, or click Open to load a file.
2. Choose Output: Formatted, Minified, or Keep layout to change only what's broken.
3. Pick an Indent of 2 spaces, 4 spaces or Tab for formatted output.
4. Check the status line, then Copy or Save the repaired JSON.

## FAQ

### What kinds of errors can it fix?

Trailing commas, // and /* */ comments, single quotes, unquoted keys, missing commas, missing closing brackets, Python True, False and None, MongoDB wrappers like ObjectId("…") and ISODate("…"), concatenated strings, and JSONP callbacks.

### Can it fix JSON from ChatGPT or another LLM?

Yes. Model output often has code fences, comments, trailing commas or a cut-off ending. The repair closes open strings, arrays and objects so the result parses.

### Will repairing change my data?

It only changes syntax. Keys and values are kept, but a cut-off value is closed where it ends, so check the end of truncated input.

### What does Keep layout do?

It returns the repaired text with your original line breaks and spacing, changing only the broken parts. Formatted and Minified re-indent the whole document.

### Why does it say it couldn't repair my input?

Some text is too ambiguous to fix safely, such as random characters between values. The message shows the line and column where repair stopped.

### Is JSON Repair free and private?

Yes. It's free with no sign-up or limits, and it runs entirely in your browser, so what you type or paste never leaves your device. It works on phones and computers alike.

## Privacy

JSON Repair runs entirely in your browser. Your files and text are processed on your device and are never uploaded.

## Related tools

- [JSON Formatter](https://toffeekit.com/tools/json-formatter) — Format, minify and validate JSON with clear errors.
- [Base64 Encode / Decode](https://toffeekit.com/tools/base64-encoder) — Encode text to Base64 or decode it back, UTF-8 safe.
- [URL Encode / Decode](https://toffeekit.com/tools/url-encoder) — Percent-encode query values or whole URLs.
- [HTML Entities](https://toffeekit.com/tools/html-entity-encoder) — Escape < > & and quotes, or decode entities.
- [JWT Decoder](https://toffeekit.com/tools/jwt-decoder) — Read a token's header, claims and expiry.
- [Hash Generator](https://toffeekit.com/tools/hash-generator) — MD5, SHA-1, SHA-256, SHA-384 and SHA-512 at once.

