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?

Large numbers, and what it deliberately doesn't "fix"

Numbers beyond double precision (integers above Number.MAX_SAFE_INTEGER such as snowflake IDs and 64-bit database keys, decimals with more than about 15 significant digits, and values that overflow or underflow a 64-bit float) are kept exactly as you wrote them. A plain JSON.parse rounds them silently; this page reads them as exact text (JSON.rawJSON) instead, and the repair list says how many it kept. They are not turned into strings. If your browser does not support JSON.rawJSON, the input is rejected rather than rounded. Only Google Chrome 154.0.8037.57 has been verified; other browsers are unverified. If you read the result with a plain JSON.parse in your own code, it rounds them again. Numbers in the subnormal range (below about 2.2e-308, for example 1.23456789012345e-320) are treated as unsafe, because a double holds them with fewer digits: they are kept as exact text where preservation is on, and rejected (422, not charged) where it is off. The API keeps these numbers only on endpoints where exact preservation is switched on; otherwise it rejects them (422, not charged).

Other control characters inside a string value (for example a stray NUL character) are not removed either: removing them would change your data, so JSON containing one is rejected. A backslash followed directly by a raw line break is rejected too, because its meaning is ambiguous. Raw line breaks and tabs inside single-quoted strings are not repaired.

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?

The tool on this page repairs the document in your browser. The document is not uploaded, and this page does not send a record of the outcome to us. The API sends the document to our servers only for the duration of that request. This applies to every tool that calls the API, including AI Repair and Workflows. For API requests we may keep an anonymized, structured record of the outcome to improve the product. That record does not include the document, and it is not used as training material for a large language model.

What is the maximum payload size?

1 MiB (1,048,576 bytes, measured in UTF-8 bytes) per request, in both browser and API mode. In the browser, larger input is rejected with a message that states the limit. The API responds with HTTP 413 and does not charge. To repair a larger document, split it into smaller parts.

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.