- Paste or type your TOML code into the text input area.
- The tool automatically processes and validates your code against the official TOML specification.
- Review the output pane; if there are syntax errors, they will be listed with exact line numbers and descriptions.
- Adjust your code based on the feedback until you receive a success message.
- Copy the corrected, valid TOML code back to your project file.
TOML Linter
TOML Linter tool on AzWebTools.
Result
Fill inputs and click run.
How to Use This Tool
Learn More About TOML Linter
What is TOML?
TOML stands for Tom's Obvious, Minimal Language. Created by Tom Preston-Werner, it aims to be a minimal configuration file format that is easy to read due to obvious semantics. TOML is designed to map unambiguously to a hash table, making it a favorite for software configuration over formats like YAML or JSON, which can sometimes be ambiguous or overly verbose.
Why Use a TOML Linter?
A single missing quote, an unclosed bracket, or a malformed datetime string in a Cargo.toml or pyproject.toml file can break your entire build process. A linter catches these syntax issues before you run your application, saving you time and frustration during development and deployment.
Common TOML Syntax Errors
- Unquoted Strings: Unlike YAML, TOML requires all string values to be strictly wrapped in quotes (e.g.,
name = "value"). - Duplicate Keys: Defining the same key twice within the same table will result in a parsing error.
- Invalid Dates: TOML has strict, built-in support for RFC 3339 formatted dates and times. Malformed dates (like using slashes instead of dashes) will fail validation immediately.
- Missing Table Brackets: Table headers must be enclosed in square brackets (e.g.,
[server]). Forgetting a closing bracket will cause parsing to fail.
The Origin of TOML
- Creator
- Tom Preston-Werner
- Initial Release
- 2013
- Latest Standard
- v1.0.0
Examples
Valid Cargo.toml
{"tomlContent":"[package]\nname = \"my-project\"\nversion = \"0.1.0\"\nedition = \"2021\"\n\n[dependencies]\nserde = \"1.0\"","lintMode":"Standard (Syntax Only)"}{
"tomlContent": "[package]\nname = \"my-project\"\nversion = \"0.1.0\"\nedition = \"2021\"\n\n[dependencies]\nserde = \"1.0\"",
"lintMode": "Standard (Syntax Only)"
}Invalid TOML (Syntax Error)
{"tomlContent":"[server]\nport = 8080\nhost = 127.0.0.1 # Missing quotes\n\n[database\nurl = \"localhost\"","lintMode":"Standard (Syntax Only)"}{
"tomlContent": "[server]\nport = 8080\nhost = 127.0.0.1 # Missing quotes\n\n[database\nurl = \"localhost\"",
"lintMode": "Standard (Syntax Only)"
}Sample Scenario
{"tomlContent":"[tool.poetry]\nname = \"toml-linter\"\nversion = \"1.0.0\"\ndescription = \"A fast linter\"\n\n[tool.poetry.dependencies]\npython = \"^3.9\"\nfastapi = \"0.68.0\"","lintMode":"Standard (Syntax Only)"}{
"tomlContent": "[tool.poetry]\nname = \"toml-linter\"\nversion = \"1.0.0\"\ndescription = \"A fast linter\"\n\n[tool.poetry.dependencies]\npython = \"^3.9\"\nfastapi = \"0.68.0\"",
"lintMode": "Standard (Syntax Only)"
}Use Cases
Validating Rust
Cargo.tomlproject manifests before compilation.Checking Python
pyproject.tomlconfigurations for syntax formatting errors.- Linting static site generator configurations (e.g., Hugo).
- Testing custom application configuration files before deployment in CI/CD pipelines.
- Learning TOML syntax by experimenting with valid and invalid data types.