Quick access

JSON Repair & LLM Output Validator

Paste JSON from ChatGPT, Claude, or Gemini that will not parse. Get valid JSON back with a list of what was fixed, then check it against your schema. Nothing leaves your browser.

Paste the whole definition; the schema inside it is found for you. Need one? Generate a schema from sample JSON.

Valid JSON appears here as you paste.

✓ Valid JSON. Nothing needed fixing.

Repaired. Fixed:

The reply was cut off, so the last value may be incomplete. Check it before you use the data.

This cannot be repaired automatically.


            

About the JSON Repair & LLM Output Validator

Language models often return JSON that almost works: wrapped in a ```json fence and a friendly sentence, with a trailing comma, single quotes, Python's True and None, or cut off halfway when the reply ran out of tokens. Paste the answer to get valid JSON back and a list of everything that was fixed, then check it against the schema your code expects.

How to use it

  1. 1 Paste the AI's answer, or any broken JSON.
  2. 2 Read what was fixed, and copy or download the clean JSON.
  3. 3 Optionally paste a JSON Schema, an OpenAI response_format, an Anthropic tool, or a Gemini responseSchema to check the data matches it.

Frequently asked questions

Why does ChatGPT return invalid JSON?

A model writes JSON one token at a time and has no parser checking its work. It can add a trailing comma, use single quotes, write True or None as Python does, add comments, or stop mid-way when it reaches its output limit. Structured outputs reduce this, but plain prompts still slip.

What can the tool repair?

Markdown code fences and text around the JSON, trailing and missing commas, single and curly quotes, unquoted keys, comments, Python and JavaScript values such as True, None, and undefined, line breaks inside strings, JSON encoded inside a string, several values in a row, and output that was cut off. It lists every kind of fix it made.

Can it finish JSON that was cut off?

It closes any open strings, arrays, and objects so the JSON parses, but it cannot know what the model would have written next. The last value may be incomplete, so check it, or ask the model to continue with a higher output token limit.

Which schema formats can I paste?

A plain JSON Schema, an OpenAI response_format or Responses text.format with json_schema, an OpenAI function or tool, an Anthropic tool with input_schema, or a Gemini responseSchema or responseJsonSchema. Paste the whole definition and the tool finds the schema inside it.

Is my data sent to a server?

No. Repair and validation run in your browser, so your JSON never leaves your device.