Skip to content

Table Format Token Comparison

Renders your own table as CSV, TSV, markdown and three JSON shapes, and ranks them by estimated tokens at whatever row count you actually have.

Cheapest format for 5 rows — CSV
79

Estimated tokens. The dearest, JSON, array of objects, indented, costs 227 — 2.87× as much for identical data.

FormatEst. tokensPer rowvs cheapest
CSV7913.81.00×
TSV7913.81.00×
Markdown table10115.81.28×
JSON, header + rows11116.81.41×
JSON, array of objects13726.81.73×
JSON, array of objects, indented22745.22.87×
Columns
4
Rows in the sample
5
Rows priced
5
Cheapest, per month
$2.37
Dearest, per month
$6.81
Difference per month
$4.44
Difference per year
$53.28

Estimated, not tokenized. Token figures here come from an approximation running in your browser: no tokenizer vocabulary is downloaded, because a real one is megabytes and nothing on this page fetches anything. It imitates how a byte-level BPE splits text — words, digit groups, punctuation runs, whitespace runs — but it has no merge table, so treat it as a planning number. The authoritative count is the usage object on a real API response.

What this assumes: Per-row cost is measured by rendering the same table with and without its data rows and dividing the difference, so it includes the separators a row carries but not the one-off header or brackets. That makes scaling to a larger row count linear, which is true for every format here. Values are assumed to be roughly the width of your sample: a table of long free-text cells shifts every format towards the same number, because the content dominates the scaffolding. Nothing here judges whether the model reads one format more reliably than another — that is a question for your evals, not your token counter.

The ranking surprises people, and it falls straight out of the arithmetic. JSON as an array of objects repeats every key on every row. With C columns and R rows you are paying for C × R copies of the column names, plus {, }, quotes, colons and commas around each one. CSV writes each column name exactly once and spends one comma per field. So the gap between them grows with row count and with how verbose your column names are — rename refund_rate to refundRatePercentage and only the JSON columns move.

Markdown tables sit in the middle and cost more than people expect, because | and the padding spaces around it are separate pieces to a tokenizer: a five-column row carries six pipes and the spaces between them, on every row, forever. CSV and TSV land close together — both spend exactly one separator per field, and which of the two wins depends on how your values merge with a comma versus a tab. The JSON "columns plus rows" shape is the interesting middle: it keeps the brackets and the quoting but names each column once, so it costs far less per row than an array of objects and the gap between those two widens with every row you add.

None of that settles which format to use. Structured formats buy you unambiguous parsing when values contain commas or newlines, and an array of objects is genuinely easier for a model to reference field by field in its answer. What the numbers above settle is the price of that convenience, so it becomes a decision rather than a default. If you are pushing thousands of rows into a prompt regularly, the honest move is usually CSV in the prompt and JSON in your code, with the column meanings explained once above the table instead of repeated on every line.

Table Format Token Comparison · Multigrid