Skip to main content
Back to Blog

Introduction to TOON: A JSON-like Format for LLM Prompts

2026-05-03 7 min read

TOON (Template Object Oriented Notation) is a human-friendly format for structuring LLM prompts and responses. Unlike JSON, TOON supports comments, is more lenient with quotes, and reads more naturally. Our JSON to TOON converter helps you translate between the two formats.

TOON Syntax Basics

TOON example
{
  // Define a user profile
  user: {
    id: 123
    name: Alice Johnson  // no quotes needed
    email: alice@example.com  // URLs work too
    verified: true
    tags: [admin, editor, contributor]  // commas optional
  }
  
  // Nested objects are intuitive
  metadata: {
    created: 2026-05-03
    source: api
  }
}

TOON vs JSON

Feature TOON JSON
Comments✓ Supported✗ Not allowed
Quote stringsOptionalRequired
Trailing commas✓ Allowed✗ Invalid
Human-readableOptimized for itSecondary concern
Parser supportSpecializedUniversal
Best forLLM prompts, configAPIs, data transfer

Real-World Use Case: LLM Prompt Structure

TOON prompt template
{
  system_prompt: "You are a helpful JSON validator."
  
  // Example inputs for the LLM
  examples: [
    {
      input: {valid_json: [1, 2, 3]}
      output: {error: null, message: "Valid"}
    }
    {
      input: {invalid: {trailing: comma,}}
      output: {error: "Unexpected token", line: 1}
    }
  ]
  
  // Instructions
  instructions:
    "Validate each JSON input and return structured feedback"
}

Why TOON for LLM Workflows

  • Comments make prompts self-documenting
  • Lenient syntax reduces parsing errors in LLM-generated output
  • More readable than JSON for human prompt engineers
  • Smaller than JSON (no quotes, optional commas)
  • Native support in emerging LLM frameworks

Convert JSON to TOON

Transform your JSON data into readable TOON format for LLM prompts.