Best LLM for JSON Extraction in 2026: All Four Were Perfect, So Pick on Cost — Carefully

By Promptster Team · 2026-08-20

Structured extraction — messy text in, strict JSON out — is one of the most common production LLM tasks. It's also one of the easiest to grade: either the output parses and matches the schema, or it doesn't.

We ran four models through three schemas of increasing difficulty, three trials each. 36 extractions, zero failures.

That's a boring headline with a genuinely useful finding underneath it.

The three schemas

Flat. A support email into five typed fields, requiring "about a dozen"12 and "not looking for a trial"false.

Nested. A sales note into a company record with an array of contacts, requiring "March"3 and "about ninety grand a year"90000.

Missing field — the trap. An invoice with no phone number in it, and a schema with "phone": string|null plus an instruction to use null for anything the text doesn't state. A correct answer emits null. A wrong answer hallucinates a plausible number or drops the key.

Results

Model Flat Nested Missing field Overall Avg cost
Gemini 3.6 Flash 3/3 3/3 3/3 9/9 $0.000447
GPT-5.6 Luna 3/3 3/3 3/3 9/9 $0.000474
Claude Sonnet 5 3/3 3/3 3/3 9/9 $0.001388
Grok 4.5 3/3 3/3 3/3 9/9 $0.001926

Every model, every schema, every trial. Including the trap — none hallucinated a phone number, all twelve attempts returned null correctly.

Extraction is a commodity. If you're choosing a model for this workload on capability, you're optimising something that's already solved. Choose on cost.

But "cheapest" depends on the shape of your task

Here's the part worth your time. Compare these two models across two different workloads we measured:

Task Output shape Grok 4.5 Gemini 3.6 Flash Cheaper
Code review Long (~300 tokens out) $0.004792 $0.008963 Grok, by 1.9×
JSON extraction Short (~50 tokens out) $0.001926 $0.000447 Gemini, by 4.3×

Same two models. Opposite rankings. Not by a little — 1.9× one way, 4.3× the other.

The mechanism is straightforward once you see it. Their list rates cross:

Gemini is cheaper on input, Grok is cheaper on output. So whichever side dominates your token mix decides the winner.

Extraction is input-heavy — you send a paragraph and get back fifty tokens of JSON, so the input rate dominates and Gemini wins. Code review is output-heavy — a short function in, a long analysis out — so the output rate dominates and Grok wins.

There is no "cheapest model." There's only the cheapest model for a given input:output ratio, which is why the common 3:1 blended price is a poor guide. Extraction workloads often run 20:1 or higher.

What we'd use

Gemini 3.6 Flash for extraction, at $0.000447 per extraction — under five cents per hundred. GPT-5.6 Luna is within noise of it, so use whichever vendor you're already on.

Don't pay for a frontier model here. Sonnet 5 costs 3× Gemini's rate for identical output, and the frontier models we've tested across this series show no advantage on tasks like these.

Do keep validating. Our schemas are small and our inputs are clean. Real extraction pipelines meet truncated text, wrong languages, adversarial input, and fields that are genuinely ambiguous rather than merely absent. Parse and schema-check every response — the model being right 36 times out of 36 on clean input says nothing about the hundredth malformed one.

And test the null case explicitly. It's the one that produces silent data corruption. A model that invents a plausible phone number fails in a way that passes schema validation and poisons your database. All four handled it here, but it's the assertion worth having in your test suite.

Run it yourself

No account, no API key:

To compare extraction cost across models on your own schemas, that's Promptster.


Run 2026-08-09 via the Promptster API, max_tokens: 4000, three trials per model per schema. Grading is exact: the output must parse, contain exactly the specified key set, and match every expected value — partial credit isn't given. Costs are per single extraction, computed from list pricing against actual token usage. The cross-task comparison uses our code-review measurements from the same week.