Embed this tool on your site
<iframe src="https://devtoolbox.dedyn.io/tools/toml-validator" width="100%" height="600" frameborder="0" title="TOML Validator & Formatter"></iframe>

TOML Validator & Formatter

Paste your TOML to validate, format, and convert it. Everything happens in your browser — your data stays private.

 
Validation results will appear here...

About TOML

TOML (Tom's Obvious Minimal Language) is a configuration file format that aims to be easy to read due to its clear semantics. Created by Tom Preston-Werner, co-founder of GitHub, TOML maps unambiguously to a hash table and is designed to be parsed into data structures in a wide variety of languages.

TOML is widely used in the Rust ecosystem (Cargo.toml), Python packaging (pyproject.toml), Hugo static site generator, and many other tools. This validator parses your TOML according to the TOML v1.0 specification and reports errors with line numbers.

Features

TOML vs YAML vs JSON

Feature TOML YAML JSON
Comments Supported (#) Supported (#) Not supported
Readability Clear, explicit sections Indentation-based, compact Verbose with braces
Date/Time types Native support Tag-based Strings only
Nesting style Dotted keys / [table] headers Indentation Braces and brackets
Designed for Configuration files Data serialization Data interchange
Ambiguity Very low Can be ambiguous None
Common use cases Cargo.toml, pyproject.toml, Hugo Docker, Kubernetes, Ansible APIs, web services
File extensions .toml .yaml, .yml .json

TOML Syntax Quick Reference

Syntax Example Description
Key-value pair name = "value" Basic assignment with =
Bare key my-key_1 = true Letters, digits, dashes, underscores
Quoted key "special key!" = 42 Any Unicode key in quotes
Dotted key server.host = "localhost" Nested key shorthand
Table [database] Section header (creates object)
Inline table point = { x = 1, y = 2 } Compact table on one line
Array of tables [[products]] Each instance adds to an array
Basic string "hello\nworld" Double quotes, escape sequences
Literal string 'C:\path\to\file' Single quotes, no escaping
Multi-line string """
multi
line
"""
Triple-quoted basic string
Integer port = 8080 Also hex, octal, binary
Float pi = 3.14159 Also inf, nan
Boolean enabled = true Only true / false
Date date = 2024-01-15 RFC 3339 format
Array tags = ["web", "api"] Comma-separated in brackets
Comment # This is a comment Hash to end of line

Frequently Asked Questions

What is TOML?
TOML (Tom's Obvious Minimal Language) is a configuration file format designed to be easy to read and write. Created by Tom Preston-Werner (co-founder of GitHub), it maps unambiguously to a hash table and is used by Rust (Cargo.toml), Python (pyproject.toml), Hugo, and many other tools.
How is TOML different from YAML and JSON?
TOML uses explicit section headers ([table]) and key = value syntax, making it less error-prone than YAML's indentation-based format. Unlike JSON, TOML supports comments, has native date/time types, and doesn't require quoting every key. TOML is designed specifically for configuration files, while JSON is better for data interchange and YAML for complex data serialization.
What are common TOML syntax errors?
Common TOML mistakes include: missing quotes around strings with special characters, using the wrong date format (TOML requires RFC 3339), redefining a key that already exists, mixing inline tables with standard table definitions, forgetting that bare keys can only contain letters, digits, dashes, and underscores, and using single quotes for escape sequences (single-quoted strings are literal in TOML).
Keyboard Shortcuts
Ctrl+Enter Validate
Ctrl+Shift+C Copy output
Ctrl+L Clear