TOON
Visualize Token-Oriented Object Notation prompts as diagrams
Token-Oriented Object Notation (TOON) compresses JSON-like payloads for LLM prompts. ToDiagram displays TOON content as diagrams so you can inspect model settings, chat messages, and tool schemas without scanning dense text.
Example
model: gpt-3.5-turbo-1106
response_format:
type: json_object
messages[2]{role,content}:
system,You are a helpful assistant that extracts data and returns it in JSON format.
user,What is the weather like in Boston?
functions[1]:
- name: get_current_weather
description: Get the current weather in a given location
parameters{type,properties,required}:
type: object
properties:
location:
type: string
description: The city and state, e.g. San Francisco, CA
unit:
type: string
enum[2]: celsius,fahrenheit
required[1]: location
function_call: autoWhat is TOON?
TOON is an open specification for storing JSON-style data with fewer tokens. It keeps nested structure with indentation while allowing inline tables, folded keys, and array annotations. Read the full spec at github.com/toon-format/spec.
The format shines when you need deterministic, compact prompts for LLMs yet still want a way to inspect the structure at a glance.
Working with TOON in ToDiagram
- Paste TOON data to see the structure laid out as nodes and edges, including model configuration, chat turns, and tool schemas.
- Collapse, search, or highlight nodes to verify prompt content before sending it to an LLM.
- Export the current diagram as PNG/SVG or share a cloud link when the diagram needs to be reviewed with teammates.
Converting to and from TOON
You can convert between any of the JSON-compatible formats supported by ToDiagram (JSON, YAML, XML, CSV) and TOON:
- Paste TOON to view a diagram and optionally export the content back as JSON.
- Paste JSON/YAML/XML/CSV data, visualize it, and download it as TOON if you need the compact representation.
- Use the download button to keep both representations in sync for downstream tools.
This allows you to review prompts visually and still keep TOON payloads ready for model input.