Skip to content

Glossary

JSON mode

JSON mode is a setting forcing a model's reply into a plain-text format software can read reliably, which guarantees the reply will parse and guarantees nothing about what is in it.

In plain terms

A promise about the envelope, not the letter. Switching it on means whatever comes back will be readable by software rather than being a paragraph with a stray sentence in front of it. What fields are inside, what they are called and whether the values are right are all separate questions the setting does not touch.

01

Why it matters

It solves a genuinely annoying problem and gets mistaken for solving a larger one. Before it existed, a step expecting machine-readable output would break whenever a model added a friendly preamble, and a great deal of fragile code existed purely to strip those. Switching it on removes that class of breakage entirely. What it does not do is make the reply the shape you wanted, which is the thing it is natural to assume you have just bought.

02

How it works

The provider constrains what the model may produce so the result is guaranteed to parse. That is a real technical guarantee rather than an instruction, which is why it works where asking the model nicely for the same thing did not.

It says nothing about which fields appear. A reply can be perfectly valid and contain field names your next step has never heard of, or omit one it was relying on. Where a provider also supports enforcing a described shape, that is the setting that answers the question people think this one answers.

Most providers require you to mention the format in the request as well, and a model told to produce this format with no description of what to put in it will invent a reasonable structure of its own. Reasonable and what you were expecting are not the same thing, which is the usual way this disappoints.

It has no bearing on whether the values are correct. A well-formed reply with an invented figure in it is the ordinary case rather than an unusual one, and the neat formatting will make it read to you as more reliable than the same claim in a sentence would.

A reply that parses perfectly and is useless

A reply that parses perfectly and is uselessEvery character here is valid and the step reading it still fails. That is the shape of the whole term: switching the setting on guarantees the reply will parse, and guarantees nothing about which fields are in it or what they are called. Left with no description of what to produce, the model invented a sensible structure of its own, which is reasonable and is not the one anything downstream was written against. The value is unverified as well, and the neat formatting will make it read as more reliable than the same claim in a sentence. So switch it on, because it removes a real class of breakage for nothing, and then describe the fields you actually want.{1 "answer": "USD 660.00",2 "confidence": "high",3 "note": "read from the second page"}Your next step was expecting total, currency, due_date.41Valid, guaranteed. That isexactly what the settingpromises and the whole ofwhat it promises.2One field where you expectedtwo, with the currencyfolded into a string nothingdownstream can read.3A field nobody asked for.Left to itself the modelinvents a reasonablestructure, and reasonable isnot yours.4The gap the setting cannotclose. Describing the fieldsyou want, and having thatdescription enforced wherethe provider supports it, iswhat closes it.
Every character here is valid and the step reading it still fails. That is the shape of the whole term: switching the setting on guarantees the reply will parse, and guarantees nothing about which fields are in it or what they are called. Left with no description of what to produce, the model invented a sensible structure of its own, which is reasonable and is not the one anything downstream was written against. The value is unverified as well, and the neat formatting will make it read as more reliable than the same claim in a sentence. So switch it on, because it removes a real class of breakage for nothing, and then describe the fields you actually want.
03

Seen in the wild

  • Switch it on for a step that kept breaking on a friendly preamble, which is the specific problem it removes.

    n8n
  • Ask for machine-readable output twice, once by request and once with the setting enabled, and see which one occasionally arrives with a sentence in front of it.

    OpenRouter
  • Send the same request with no description of the fields you want and read what structure comes back, which will be reasonable and not yours.

    ChatGPT
04

Common misconceptions

People assume

It makes the output the right shape.

In fact

It makes the output parseable. Which fields exist and what they are called is a separate matter, answered by describing the shape you want and, where the provider supports it, having that description enforced. Treating this setting as shape control is the characteristic disappointment here.

People assume

Valid output means correct output.

In fact

The two are unconnected, and the formatting makes the error harder to notice. A tidy reply with a fabricated value passes every check a machine can perform on it, which is precisely why the checks that matter have to look at the values rather than the structure.

05

Telling them apart

JSON mode vs Structured output

JSON mode

A guarantee about the format: the reply will parse. Narrow, reliable, and silent on content.

Structured output

A description of the fields you want, and where supported, enforcement of it before the reply reaches you.

Switch this on and describe the shape as well. On its own it removes a breakage and leaves the question you actually had.

06

Questions

Should we just always switch it on?
For anything a machine reads, yes, since it costs nothing and removes a class of breakage. Just do not stop there. Describe the fields you want in the request, and where the provider offers enforcement of that description, use it, because that is what answers the shape question.
Why did we get valid output with the wrong field names?
Because nothing told the model which names to use. Left to itself it produced a sensible structure, which is not yours. Describing each field, with the name you want and a short explanation of what belongs in it, fixes this and takes a few minutes.
What should we check, given it guarantees only the format?
Point your checks at the values rather than the structure, because the structure is now the one thing that cannot be wrong. Compare a sample of extracted figures against the source documents they came from, and treat a field that arrived empty as a result worth reading rather than a record to skip.
07

Key takeaways

  • It guarantees the reply will parse, and guarantees nothing about the fields or the values.
  • It is a real technical constraint rather than an instruction, which is why it works reliably.
  • Without a description of the fields you want, the model invents a reasonable structure of its own.
  • Neat formatting makes an invented value read as more trustworthy than the same claim in a sentence.
  • Switch it on and describe the shape as well; on its own it answers the smaller half of the problem.
09

Tools that use this

  • n8n

    The step that kept breaking on a preamble, and stops.

  • OpenRouter

    Requested against enforced, where the difference shows occasionally.

  • ChatGPT

    No field description, so the structure that comes back is the model's.

Last checked July 2026

All glossary terms