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
- Paste valid JSON, open a file up to 2 MiB, or try the example.
- Compare the token counts for compact JSON and TOON. Neither format is always smaller.
- Optionally choose a section, keep selected fields, or limit the first rows. These choices leave data out and are marked as partial data.
- 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
- JSON FormatterIndent with 2 or 4 spaces, sort keys
- JSON ValidatorLine and column of the first error
- JSON MinifierRemove whitespace, see the bytes saved
- JSON RepairFixes quotes, commas, comments, AI output
- JSON Schema GeneratorA JSON Schema from examples
- JSON Token CounterCount tokens, select data, compare JSON and TOON
- Large JSON ViewerTree, table and search for huge files
- JSON Lines ViewerJSONL and NDJSON logs as a table
- JSON VisualizerThe data as a graph, PNG and SVG export
- JSON DiffChanges between two documents
- JSON Path FinderClick a value, copy its path
- JSONPath TesterJSONPath, JMESPath and jq, live
- JMESPath PlaygroundJMESPath, for AWS CLI queries too
- jq PlaygroundReal jq in your browser
- JSON to CSVNested objects become dotted columns
- CSV to JSONDelimiters detected, 007 stays 007
- JSON to XML@keys become attributes
- XML to JSONRSS feeds, sitemaps, SOAP responses
- JSON to YAMLReadable YAML, ambiguous strings quoted
- YAML to JSONAnchors and multiple documents
- JSON Lines to JSONNDJSON or JSONL into one array
- JSON to TypeScriptInterfaces inferred from your data
- JSON to TOONConvert JSON to TOON, with token counts
- JWT DecoderHeader, payload and expiry, locally
- JSON EscapeText to a JSON string and back
- Sample JSON FilesDownload test JSON, 100 KB to 1 GB
- Sample CSV FilesDownload test CSV, 100 KB to 1 GB
- Sample XML FilesDownload test XML, 100 KB to 1 GB
- Large JSON File GeneratorTest data from 100 KB to 1 GB