I counted tokens for the same data in 7 formats. Pretty JSON costs 3 CSV
This story is from 2026-10-02. It is preserved in the archive; the latest stories are on the live feed.
Most of us paste data into LLM prompts as JSON, often straight from JSON.stringify(data, null, 2) . I had never checked what that costs in tokens, so I took one table, wrote it in seven formats and counted. Short version: pretty-printed JSON uses about 3× the tokens of CSV. The setup A product tabl…
Read the full story at DEV Community — AI ↗
Timeline · 1 report
- 2026-10-02 17:03 · DEV Community — AI
I counted tokens for the same data in 7 formats. Pretty JSON costs 3 CSV