Guide

How to use JSON to TOON

Learn the flow, key features, and API use cases for workflows like n8n, agents, and middleware.

How to use

  1. Paste JSON or upload a file on the home page.
  2. Select formatting: indentation, key folding, delimiter, and duplicate handling.
  3. Click Convert to TOON. Review token savings and copy/download.
  4. For API usage, call POST /api/convert with your payload.
Features
- Live token counts and reduction stats
- Safe JSON validation before convert
- Large file support (browser-side)
- API tokens via dashboard, revoke anytime
- Light/dark theme and downloadable output
API use cases
- n8n: HTTP Request node → POST /api/convert → feed TOON to LLM nodes
- Zapier/Webhooks: preprocess JSON before model calls
- Agents/RAG: shrink context payloads on the fly
- CI/CD: run conversion in build steps to store TOON alongside JSON

Quick API example

Call the converter from workflows (n8n, Zapier, or custom middleware). For private usage, include your API token in x-api-key.

curl -X POST https://jsontotoon.in/api/convert \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_TOKEN_HERE" \
  -d '{"json":{"users":[{"id":1,"name":"Alice"}]},"indentation":"none","keyFolding":"safe","delimiter":","}'
Response: { "toon": "...", "stats": { ... } }. Use the toon string directly in LLM prompts to cut token usage.