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
- 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.
- 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.
- 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
- 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 Schema ValidatorCheck JSON against a schema
- JSON Token CounterCount tokens, select data, compare JSON and TOON
- JSON EditorTree and code editing, undo and history
- Large JSON ViewerTree, table and search for huge files
- JSON Lines ViewerJSONL and NDJSON logs as a table
- JSON Log ViewerCount and filter JSON Lines logs
- Large CSV ViewerCSV files too big for Excel, up to 1 GB
- 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
- JSON to ExcelAn .xlsx sheet, numbers kept as numbers
- 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 JSON LinesA JSON array as one record per line
- JSON to TOONConvert JSON to TOON, with token counts
- JSON to MermaidA flowchart or class diagram, drawn
- JSON SplitterCut a big file into parts, or sample it
- JSON to TypeScriptInterfaces inferred from your data
- JSON to GoGo structs with json tags
- JSON to RustRust structs that derive serde's Serialize and Deserialize
- JSON to PythonPython dataclasses with type hints
- JSON to JavaJava classes with getters and setters
- JSON to C#C# classes with System.Text.Json attributes
- JSON to KotlinKotlin data classes
- JSON to SwiftSwift structs that conform to Codable, with CodingKeys
- JSON to DartDart classes with fromJson and toJson
- JSON to ZodZod schemas with TypeScript types inferred from them
- 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 JSON Lines FilesDownload test NDJSON, one record per line
- Sample CSV FilesDownload test CSV, 100 KB to 1 GB
- Sample XML FilesDownload test XML, 100 KB to 1 GB
- Sample GeoJSON FilesPoints, lines and polygons, up to 1 GB
- Sample Nested JSONRecords 8 levels deep, up to 1 GB
- Sample Unicode JSON13 scripts, emoji and escapes
- Sample API ResponsesJSON:API, HAL, GraphQL, pages, errors
- Large JSON File GeneratorTest data from 100 KB to 1 GB