JSON

AI JSON fixer

An AI fixer is only useful if you can trust what it does. Here is exactly how DocuFormat uses AI on broken JSON, what stays deterministic, and what you stay in control of.

input.jsonDetected: JSON ✗
{  "user": {    "id": 7,    "roles": ["admin", "dev"  },  "active": true}
✗ 1 error · AI Fix available
suggested.jsonAI suggestion
{  "user": {    "id": 7,    "roles": ["admin", "dev"]  },  "active": true}
✓ Passes local re-validation

Deterministic first, AI second

DocuFormat detects the format, parses, validates and pretty-prints without a model. The AI step is separate and optional. When validation fails, the local diagnostics (line, column, message) are passed along with your input so the model can target the real problem instead of guessing.

What happens when you click AI Fix

  1. You click AI Fix. Nothing is sent before this.
  2. The first time in a session, DocuFormat shows a notice that your content will be sent to an external AI provider, and asks you to confirm.
  3. The request goes through DocuFormat’s server to the AI provider.
  4. You get a proposed correction, a plain-language explanation and a list of problems found.
  5. DocuFormat validates the proposal locally and shows the result.
  6. You decide: Use as input, Format suggestion or Discard.

What it is told to do

The repair instructions tell the model to treat your content as data, not instructions; to preserve the original intent; to make the smallest changes needed; and not to invent data or remove content unless required for validity.

Secrets are not redacted. Tokens and keys in your input are passed as written, so remove anything sensitive before using an AI action.

Limits worth knowing

  • AI requests accept up to 512 KB of input.
  • AI output can be wrong. That is why it is never applied automatically and is always re-validated.
  • AI Fix needs the application’s AI provider to be configured; basic formatting and validation do not.

For the plain formatting side, see the JSON formatter; for common causes of invalid JSON, the JSON fixer.

Questions, answered

Does DocuFormat send my JSON to an AI automatically?

No. Content is only sent after you click AI Fix or Explain, and the first time you are asked to confirm.

Is the AI-fixed JSON guaranteed valid?

No guarantee, which is why DocuFormat re-validates it locally and shows you the result before you use it.

Which AI provider does it use?

The server forwards requests to an AI provider (currently Anthropic). The application shows which model is in use.

Can I use it for formats other than JSON?

Yes. AI Fix and Explain work for YAML, XML, CSV, SQL, cURL and shell commands as well.

Try the JSON formatter on your own input.

Paste it, format it, and fix it if it is broken, once DocuFormat opens.