Skip to content
Writing

4 November 2025

Why JSON wastes LLM tokens, and how to fix it without losing data

JSON was built for parsers, not per-token pricing. XRON restructures the exact same data to cost up to 80 per cent fewer tokens.

Every time you feed structured data into a language model, you pay for JSON's legacy design decisions twice: once in hard dollars, and once in blown context windows.

Where the waste comes from

JSON relentlessly repeats every key for every object in an array. It wraps everything in endless braces, brackets, and quote marks. Tokenisers dutifully chop all of that into tokens that carry zero useful information—the hundredth repetition of a field name tells the model absolutely nothing new.

In a single API call, this waste is a rounding error. In agentic systems, it's a fatal flaw. Agents pass structured data back and forth constantly: tool results, state, intermediate outputs. That overhead compounds with every single hop, forcing long conversations to hit the context ceiling long before they should.

What XRON does

XRON is a lossless data serialisation format I built in TypeScript. 'Lossless' is the critical word here—nothing is summarised, truncated, or hallucinated. The exact same information is simply restructured to consume up to 80 per cent fewer tokens.

The result is entirely practical: context windows stretch significantly further, API costs drop, and multi-agent systems survive much longer conversations before degrading.

Why a marketer built a serialisation format

Performance media burned two habits into my brain: automate the repetitive work, and aggressively protect data quality, because every downstream decision inherits your upstream mess. LLM workflows over structured data share the exact same shape. The format of your data is an input cost, and the industry was completely ignoring it.

XRON is open source on GitHub right now. The cheapest token is the one you never have to send.

XRON runs in the browser, so you can try it on your own payload — paste JSON in, pick a compression level, and watch it decode back to check nothing was lost. Open the live demo.

Frequently asked questions

Why does JSON waste tokens when used with language models?
It repeats every key for every object in an array and wraps everything in braces, brackets and quote marks. A tokeniser splits all of that into tokens carrying no information the model needs.
Does that overhead matter for a single API call?
Barely — in one call it is a rounding error. In agentic systems it compounds, because agents pass structured data through the model many times per task, so long conversations reach the context ceiling earlier than they should.
Does XRON summarise or approximate the data?
No — restructuring is the whole approach, and the goal is that the same information decodes back to exactly what went in. That is a claim worth testing rather than trusting, which is why the XRON page runs the decode in your browser on whatever you paste and tells you whether it matched.
Is XRON open source, and what is it written in?
Yes, it is open source on GitHub, and it is written in TypeScript.

More reading

All writing

Related case study XRON — open source