• Tool
  • AI and intelligent systems
  • Beta

Token Intelligence

See how many AI tokens your data costs in seven formats, including TOON, and check that nothing is lost. Your data stays on your device.

Token Intelligence workspace

Loading Token Intelligence…

How your data is handled

Token Intelligence runs in your browser. The text and files you use are processed on your device and are not sent to Digital Campaign or anyone else.

Nothing you enter is saved. Reloading or closing the page clears it.

Limits: Files up to 5 MB and 50,000 rows. CSV, Excel (.xlsx) and JSON. Text up to 5 MB.

If you accept analytics, we count visits to this page. We do not record what you enter. Your browser, its extensions and your device are outside our control.

What Token Intelligence does

Token Intelligence shows how much the same data costs an AI model in seven different formats. Load a CSV, Excel or JSON file and it writes your data as indented JSON, compact JSON, CSV, a Markdown table, XML, YAML and TOON. It counts the tokens in each one and puts the results side by side, so you can see which format is cheapest before you build it into a prompt, an agent or a data feed.

It also has a Count text step. Paste a prompt, a brief or a document and it tells you how many tokens it uses with each counter.

Everything happens in your browser. Your data is read and counted on your device and is never uploaded, and the page never connects to an AI model.

What a token is

AI language models do not read letters or words. They read tokens, which are short pieces of text. A common English word is often one token. A long or unusual word may be two or three. Spaces, punctuation, numbers and symbols all take tokens too.

Tokens matter for three reasons. Most AI services charge by the token, both for what you send and for what comes back. Every model has a limit on how many tokens it can hold at once, called its context window. And the more tokens a model has to read, the longer it takes to reply. Cutting tokens you do not need saves money, leaves more room for useful context and makes answers faster.

Why the format matters

When you pass a table of data to a model, the values are only part of what it reads. The format adds its own text around them. Indented JSON repeats every column name on every row and adds quotes, brackets and spaces. XML wraps each value in tags. A Markdown table adds pipes and a divider row. On a large table, this extra text can use more tokens than the data itself.

Formats built for tables, such as CSV and TOON, write each column name once and then list the rows. That is why they are usually much smaller for data where every record has the same fields. The best choice still depends on your data, which is why it helps to measure it.

  • JSON (indented): easy for people to read and the most common format for data feeds. It is used as the baseline, because it is what most systems produce by default.
  • JSON (compact): the same data with the spaces and line breaks removed. Cheaper, and still valid JSON.
  • CSV: one header row and one line per record. Very compact, but every value is text, so a model cannot tell the number 42 from the text 42.
  • Markdown table: readable in chat tools and documents. The pipes and divider row add cost.
  • XML: the most verbose of the seven, because every value has an opening and a closing tag.
  • YAML: readable, with fewer brackets than JSON, but it still repeats every column name on every record.
  • TOON: a newer format designed for models. It lists the column names once, like CSV, but keeps numbers, true and false as values and quotes text only when it has to.

About TOON

TOON stands for Token-Oriented Object Notation. For a table of records, a TOON document starts with a header that gives the number of rows and the column names, followed by one indented line per row. Token Intelligence follows version 4.4 of the public TOON specification for this tabular form. We explain why it matters in why TOON will replace JSON at the LLM boundary, and our guide on why marketing teams should care about token efficiency covers the wider picture.

A cheaper format is only useful if it keeps your data intact. So for JSON, compact JSON, CSV and TOON, Token Intelligence reads the output back and checks every value against your original data. If they all match, the result is marked Lossless. If anything differs, it shows the first row and column that changed. XML, YAML and Markdown are marked Not checked.

How to use it

  1. Choose a token counter. Pick the counter that matches the model you use. The list below explains which are exact.
  2. Load your data. Choose a CSV, Excel (.xlsx) or JSON file, or select Use example data to try a small campaign report.
  3. Compare formats. The results table shows the tokens for each format, the difference from indented JSON, the number of characters and the round trip check. The bars give a quick visual comparison.
  4. Preview and download. Choose a format to see it, then download it as a file or copy it to use in a prompt.

By default, numbers and the words true and false are written as values in JSON, YAML and TOON. Switch this off if your data has codes that look like numbers, such as product codes, and you want them kept as text.

How tokens are counted

Each AI company uses its own tokeniser, so the same text can have a different count with each model. Token Intelligence gives you three counters and always tells you whether a count is exact.

  • OpenAI o200k_base: exact. This is the tokeniser for the GPT-4o family and newer OpenAI models.
  • OpenAI cl100k_base: exact. This is the tokeniser for GPT-4 and GPT-3.5.
  • Estimate: one token for every four characters. Use it for Claude, Gemini and other models whose tokenisers are private. The results say About in front of each number, because the estimate is a rough guide.

The exact counts come from gpt-tokenizer, an open source library under the MIT licence. It runs inside the page, so nothing is sent to OpenAI or anyone else. Even an estimate is useful for comparing formats. It usually puts them in the same order as the exact counters, though formats with similar counts can swap places.

Limits and privacy

  • Files can be up to 5 MB and 50,000 rows. Each version of the data must also stay under 32 MB, which matters most for XML, as it is often six times the size of the CSV. Token counts grow in proportion to the data, so a sample gives a good guide for a larger file.
  • Text on the Count text step can be up to 5 MB.
  • The first count with each OpenAI counter takes a moment, because its word list has to load. Later counts are quicker.
  • Nothing is uploaded or saved. The page's security settings stop it from connecting to any other server. Closing or reloading the page clears your data.

Questions people ask

Why is there no exact count for Claude?

Anthropic does not publish the tokeniser for its current models, so no tool can count them exactly in a browser. Anthropic offers a token counting service through its API, but using it would mean sending your data away. The estimate keeps everything on your device.

Will a model understand TOON as well as JSON?

Current models read TOON well, because it looks a lot like CSV and YAML, which they have seen many times. It is still worth testing with your own model and task before you switch a live system. Token Intelligence tells you what you would save, so you can decide whether the test is worth it.

Why does CSV sometimes beat TOON?

CSV has the least extra text of any format, so on some data it is the smallest. The trade off is that CSV has no types: every value is text. TOON costs a little more but keeps numbers and true or false values, which helps a model work with them correctly.

Can I use the output in my own system?

Yes. Download or copy any format and use it as you like. The JSON and CSV are standard, and the TOON output follows the public specification, so any TOON library can read it.

Version 0.1.0. Last updated 29 November 2026.

Send feedback or report a problem