Skip to the tool
GigaJSON

JSON Token Counter

All tools
Format and check
View and query
Convert
JSON to code
Encode and decode
Sample files
Guides Open GigaJSON

Get JSON ready for an AI prompt without sending it to an AI service. Count the tokens in your text, compare compact JSON with TOON, then keep the section, fields or first rows your task needs. The preview shows what you'll copy and how its token count compares with your input. For a direct conversion with all data preserved, use JSON to TOON.

How to use it

  1. Paste valid JSON, open a file up to 2 MiB, or try the example.
  2. Compare the token counts for compact JSON and TOON. Neither format is always smaller.
  3. If you like, pick a section, keep some fields, or limit the rows. Each of these leaves data out, and the output gets marked as partial.
  4. Review the output, then copy it or download it for your prompt.

Read more: What is the TOON format? Syntax and examples · JSON vs TOON: token counts measured on six kinds of data · How to reduce JSON tokens for AI prompts

Private, local processing

This tool runs in your browser, in a background worker: nothing you paste or open is uploaded, and nothing is kept after you leave. This tool accepts up to 2 MiB of JSON and 64 levels of nesting. Filter larger files in the workspace first. Already loaded features keep working if your connection drops. Loading another tool or jq for the first time needs a connection. When one tool isn't enough, GigaJSON opens your data with a tree, a table, JSONPath/JMESPath/jq queries, transforms, diff and history.

Questions

Does this call an AI model?

No. Token counting, selection and format conversion run locally in a background worker. No API key, AI model or upload is needed.

Are these exact token counts for every AI model?

They're real token counts from the o200k_base tokenizer, where many tools estimate from characters. Other tokenizers count differently, and a full API request adds message and tool overhead, so don't treat the numbers as a bill.

Will TOON always save tokens or improve answers?

No. TOON shares field names across similar records, which helps with table-like data, while compact JSON can be smaller for other shapes. Fewer tokens won't guarantee better answers either. Go by the counts on screen, and pick JSON whenever your workflow needs JSON.

Does reducing tokens remove my data?

Converting the format keeps the selected JSON values. Choosing a section, unticking fields or limiting rows removes data from the output, and the tool labels the result as partial. Your input stays as it was. The tool refuses duplicate keys and numbers it can't represent exactly, so nothing changes without you knowing.

Can I use a 1 GB file here?

It accepts up to 2 MiB of JSON and 64 levels of nesting. For a larger file, open it in the GigaJSON workspace, filter to the records you need with JSONPath, JMESPath or jq within their limits, and prepare that smaller result here.

All tools