Skip to the tool
GigaJSON

JSON Token Counter

All tools
Guides Open GigaJSON

Prepare JSON for an AI prompt without sending it to an AI service. Count the original text, compare compact JSON with TOON, then select the section, fields or first rows your task needs. The preview shows exactly what will be copied 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. Optionally choose a section, keep selected fields, or limit the first rows. These choices leave data out and are marked as partial data.
  4. Review the output, then copy it or download it for your prompt.

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?

These are text token counts using the o200k_base tokenizer, not a character-based estimate. Other tokenizers can produce different counts. Full API requests also include message, tool and other overhead, so this is not a billing quote.

Will TOON always save tokens or improve answers?

No. TOON shares repeated field names across similar records, which can help with tabular data. Compact JSON can be smaller for other structures. Fewer tokens do not guarantee better answers. Use the displayed counts and choose JSON when your workflow requires JSON.

Does reducing tokens remove my data?

Format conversion preserves the selected JSON values. Choosing a section, unchecking fields or limiting rows does remove data from the output; the tool labels this clearly. The original input is never changed. Duplicate keys and numbers that cannot be represented precisely are refused rather than silently changed.

Can I use a 1 GB file here?

This first version 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