FlyingFish Space

Clean broken JSON. Instantly. No login.

Paste malformed JSON — we fix encoding errors, bad escapes, truncation, and more.


What is JSON Clean?

JSON Clean is a free online tool that automatically detects and repairs malformed JSON. It runs up to 11 repair stages in sequence, handling the most common sources of broken JSON produced by LLMs, copy-paste from documents, legacy APIs, and truncated payloads.

Unlike format converters, JSON Clean is a syntax fixer. It accepts JSON-like input and returns valid, parseable JSON. It does not convert CSV, XML, PDF, or plain text into JSON.

What errors does it fix?

What it deliberately doesn't "fix"

Numbers exceeding safe precision — decimals with more than ~15 significant digits, or integers larger than Number.MAX_SAFE_INTEGER (snowflake IDs, 64-bit database keys, and similar) — are not repaired. JavaScript's JSON.parse silently rounds these to the nearest representable value, with no warning and no way to recover the original number afterward. Rather than return a plausible-looking but wrong result, JSON Clean rejects the input outright and tells you which values are affected. If you need to preserve exact precision, encode those values as strings instead of numbers.

How to use

Paste your broken JSON into the left panel and click Clean JSON. The repaired result appears in the right panel instantly. Each repair applied is listed as a tag below the editor. You can copy the result to clipboard or download it as a .json file.

No account required for browser use. For programmatic access, get a free API key on the Billing page — 100 credits included, no email needed.

API usage

Send a POST request to https://json.flyingfishspace.com/api/json/v1/clean with your raw JSON as the request body and your API key in the X-API-Key header. One credit is deducted per successful repair. Failed or unrecoverable requests are not charged.

See the API documentation for full endpoint reference, response format, and code examples in Node.js, Python, and Go.

Frequently asked questions

Is my data stored or logged?

No. The browser-based tool on this page runs entirely in your browser — your JSON never leaves your device. Only the separate API endpoint (documented below) sends data to our servers, and even then nothing is stored or logged beyond the moment of processing.

What is the maximum payload size?

1 MB per request for both browser and API mode.

What happens if my JSON cannot be repaired?

The tool returns a success: false response with the partial repairs that were applied before the structure became unrecoverable. No credit is deducted.

Can I use this for AI-generated JSON?

Yes. JSON Clean is specifically effective on LLM output, which commonly includes trailing commas, markdown fences, JavaScript comments, and truncated structures. For severely malformed AI output, use AI Repair, which uses a language model to reconstruct the intended structure.