{
  "slug": "data",
  "title": "json ⇄ yaml ⇄ toml ⇄ toon converter",
  "description": "Convert between JSON, YAML, TOML, and TOON — auto-detects the input, points at the exact parse error, and shows the token-count savings of TOON's compact tabular arrays.",
  "category": "convert",
  "status": "live",
  "url": "https://aaronchartier.com/tools/data",
  "keywords": [
    "json",
    "yaml",
    "toml",
    "toon",
    "convert",
    "config",
    "front matter",
    "token",
    "llm",
    "agent-ready"
  ],
  "samples": [
    {
      "label": "json → yaml",
      "query": "input=%7B%22name%22%3A%22demo%22%2C%22tags%22%3A%5B%22a%22%2C%22b%22%5D%7D&to=yaml"
    },
    {
      "label": "toml → json",
      "query": "input=title%20%3D%20%22demo%22%0A%5Bserver%5D%0Aport%20%3D%208080&to=json"
    },
    {
      "label": "json → toon (token savings)",
      "query": "input=%7B%22users%22%3A%5B%7B%22id%22%3A1%2C%22name%22%3A%22Alice%22%2C%22role%22%3A%22admin%22%7D%2C%7B%22id%22%3A2%2C%22name%22%3A%22Bob%22%2C%22role%22%3A%22user%22%7D%5D%7D&to=toon"
    }
  ],
  "privacy": "all computation is client-side; no input is transmitted",
  "pageApi": "window.__tools[\"data\"] — run(input), describe(); output in #tool-output",
  "params": {
    "input": "the document to convert (`#input=` pre-fills and auto-runs)",
    "from": "'auto' | 'json' | 'yaml' | 'toml' | 'toon' (default auto-detect; `#from=`) — toon is never auto-detected, pass it explicitly",
    "to": "'json' | 'yaml' | 'toml' | 'toon' (default json; `#to=`)"
  },
  "returns": "{ ok, from (detected when auto), to, detected?, output?, error?: { message, line?, column? } } — TOML needs an object root and drops nulls; multi-doc YAML is rejected; TOON round-trips any root shape (no column in its errors) but only gets token-compact on uniform arrays of objects",
  "example": {
    "run": {
      "input": "title = \"demo\"\n[server]\nport = 8080",
      "from": "toml",
      "to": "yaml"
    }
  }
}