Formatea, valida y convierte TOML ↔ JSON en el navegador. No se envían datos a ningún servidor.
| Type | Example | Notes |
|---|---|---|
| String (basic) | name = "Alice" | Supports \n, \t, \uXXXX escapes |
| String (literal) | path = 'C:\Users\Alice' | No escape processing — use for regex, paths |
| Multi-line string | desc = \"\"\" Line 1 Line 2\"\"\"`` | Opening newline trimmed |
| Integer | count = 42 hex = 0xFF bin = 0b1010 | Underscores allowed: 1_000_000 |
| Float | pi = 3.14159 sci = 5e22 inf = inf | nan also valid |
| Boolean | debug = true verbose = false | Always lowercase |
| Offset Date-Time | created = 1979-05-27T07:32:00Z | RFC 3339 / ISO 8601 |
| Local Date | date = 2024-01-15 | No time, no timezone |
| Array | tags = ["rust", "config"] | Mixed types allowed; multi-line OK |
| Inline Table | point = {x = 1, y = 2} | Must be on a single line |
| Table | [server] host = 'localhost' | Maps to nested object |
| Array of Tables | [[users]] name = 'Alice' | Creates an array of objects |
| Feature | TOML | JSON | YAML |
|---|---|---|---|
| Comments | ✓ | ✗ | ✓ |
| Trailing commas | N/A | ✗ | N/A |
| Native dates | ✓ | ✗ | ✓ |
| Multi-line strings | ✓ | ✗ (escape \n) | ✓ |
| Implicit type coercion | ✗ | ✗ | ✓ (risky) |
| Human readability | High | Medium | High |
| Machine readability | High | High | Medium |
| Use case | Config files | APIs / data exchange | Config / automation |
TOML (Tom's Obvious, Minimal Language) es un formato de archivo de configuración diseñado para ser fácil de leer gracias a su semántica obvia. Se mapea sin ambigüedad a una tabla hash y está diseñado como alternativa a YAML y JSON para archivos de configuración. TOML es usado por Cargo de Rust, Poetry de Python y muchas otras herramientas.
A diferencia de JSON, TOML soporta comentarios, cadenas multilínea y tipos nativos de fecha/hora. A diferencia de YAML, TOML tiene una sintaxis explícita e inequívoca: no hay conversiones de tipos implícitas sorprendentes ni problemas de sangría. TOML se prefiere generalmente para archivos de configuración mientras que JSON se prefiere para APIs de intercambio de datos.
Una tabla TOML se define con la sintaxis [nombre.tabla] y se mapea a un objeto anidado. Un array de tablas usa [[nombre.array]] (dobles corchetes) y crea un array de objetos. Las tablas inline usan la sintaxis {clave = valor} para representaciones compactas. Las tablas soportan anidamiento arbitrario para configuración jerárquica.
TOML soporta: String (básico y literal/raw), Integer (decimal, hex 0x, octal 0o, binario 0b), Float (incluyendo inf y nan), Boolean (true/false), Offset Date-Time (RFC 3339), Local Date-Time, Local Date, Local Time, Array (tipos mixtos permitidos) y Table/Inline Table.