CodeInWord

TOON 格式
TOON 输入区域
JSON 格式
JSON 输出区域

TOON 与 JSON 转换工具

TOON(Token-Oriented Object Notation)是一种紧凑的、人类可读的、支持模式的 JSON 格式,专为 LLM 提示设计。此工具可以帮助您在 TOON 格式和 JSON 格式之间进行双向转换。

所有操作均在浏览器本地完成,不保存任何用户数据,保护您的隐私安全。

什么是 TOON?

TOON 是一种专门为 LLM(大语言模型)提示设计的紧凑数据格式。它比 JSON 更节省 token,同时保持人类可读性。TOON 特别适合处理统一的对象数组(具有相同字段和原始值的对象)。

TOON 格式的主要特点:

TOON 示例

users[3]{id,name,role,lastLogin}:
  1,Alice,admin,2025-01-15T10:30:00Z
  2,Bob,user,2025-01-14T15:22:00Z
  3,Charlie,user,2025-01-13T09:45:00Z

对应的 JSON 格式:

{
  "users": [
    { "id": 1, "name": "Alice", "role": "admin", "lastLogin": "2025-01-15T10:30:00Z" },
    { "id": 2, "name": "Bob", "role": "user", "lastLogin": "2025-01-14T15:22:00Z" },
    { "id": 3, "name": "Charlie", "role": "user", "lastLogin": "2025-01-13T09:45:00Z" }
  ]
}

TOON to JSON Converter

TOON (Token-Oriented Object Notation) is a compact, human-readable, schema-aware JSON format designed for LLM prompts. This tool helps you convert between TOON format and JSON format bidirectionally.

All operations are completed locally in your browser, we do not save any of your information, protecting your privacy.

What is TOON?

TOON is a compact data format specifically designed for LLM (Large Language Model) prompts. It is more token-efficient than JSON while maintaining human readability. TOON is particularly suitable for handling uniform arrays of objects (objects with the same fields and primitive values).

Main features of TOON format:

TOON Example

users[3]{id,name,role,lastLogin}:
  1,Alice,admin,2025-01-15T10:30:00Z
  2,Bob,user,2025-01-14T15:22:00Z
  3,Charlie,user,2025-01-13T09:45:00Z

Corresponding JSON format:

{
  "users": [
    { "id": 1, "name": "Alice", "role": "admin", "lastLogin": "2025-01-15T10:30:00Z" },
    { "id": 2, "name": "Bob", "role": "user", "lastLogin": "2025-01-14T15:22:00Z" },
    { "id": 3, "name": "Charlie", "role": "user", "lastLogin": "2025-01-13T09:45:00Z" }
  ]
}