AI JSON Fixer

Extract and fix JSON from mixed LLM output — handles prose, markdown, and concatenation.

Paste mixed text or broken JSON above to extract and fix it

Related Tools

Learn More

FAQ

How does the JSON extraction work?
The tool scans the input text for the first { or [ character, then walks forward tracking nesting depth to find the matching } or ]. Everything between those positions is extracted as the JSON candidate, which is then repaired and parsed.
What happens if the model output contains multiple JSON objects?
If multiple top-level { } objects are detected in the input (concatenated without separators), the tool wraps them in a JSON array [ ... ] so the output is valid JSON. This handles the common case of models outputting object after object.
When should I use JSON Fixer vs JSON Repair?
Use JSON Repair when your input is already mostly JSON with minor syntax errors. Use JSON Fixer when the model output is a longer message that contains JSON embedded in prose, or when there are multiple JSON blobs concatenated together.

Aggressive JSON extraction and repair for LLM outputs that mix JSON with prose, markdown, or multiple objects. Finds the first { or [ in the text, extracts to the matching closer (handling full nesting), then applies all standard repairs: markdown fence stripping, trailing comma removal, single-to-double quote conversion, key quoting, bracket balancing, and comment removal. Handles concatenated top-level objects by wrapping them in an array.