Skip to content

Kelin2025/toon-playground

Repository files navigation

JSON to TOON Converter

A web application that converts JSON to TOON (Token-Oriented Object Notation) format, designed to reduce LLM token usage by 30-60% compared to standard JSON.

🌐 Live Demo: https://toon-playground.pages.dev

Features

  • Real-time JSON to TOON conversion
  • Token compression statistics (using GPT tokenizer)
  • Configurable delimiter options (comma, tab, pipe)
  • Optional length marker support
  • Copy to clipboard functionality
  • Beautiful, responsive UI

Getting Started

Install dependencies:

bun install

Run the development server:

bun run dev

Open your browser to http://localhost:3001

Deployment

Deploy to Cloudflare Pages:

bun run deploy

What is TOON?

TOON (Token-Oriented Object Notation) is a compact, human-readable format designed for passing structured data to Large Language Models with significantly reduced token usage. It's particularly efficient for uniform complex objects with multiple fields per row.

Learn more: github.com/johannschopplich/toon

Usage

  1. Paste your JSON into the left textarea
  2. View the token compression statistics at the top
  3. Choose delimiter and length marker options to optimize compression
  4. View the TOON output on the right
  5. Click "Copy" to copy the result to clipboard

Example

Input JSON:

{
  "users": [
    { "id": 1, "name": "Alice", "role": "admin" },
    { "id": 2, "name": "Bob", "role": "user" }
  ]
}

Output TOON:

users[2]{id,name,role}:
  1,Alice,admin
  2,Bob,user

This project was created using bun init in bun v1.2.21. Bun is a fast all-in-one JavaScript runtime.

About

Playground for TOON - JSON for LLMs at half the token cost

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published