What is a .toml file?
Tom's Obvious, Minimal Language · Code and data · Tom Preston-Werner · 2013
TOML is a plain-text configuration file format designed to be obvious to read, using key = value lines under [section] headers instead of YAML's whitespace rules or JSON's brackets. It is the standard config format for Rust's Cargo and modern Python packaging, among many other developer tools.
What is a .toml file used for?
TOML uses key = value lines grouped under [section] headers, aiming to be unambiguous at a glance rather than relying on YAML's significant whitespace or JSON's brackets and quoting.
Every value has an explicit, obvious type, string, number, boolean, date or array, which avoids some of the parsing surprises YAML is known for, such as an unquoted country code being read as something other than text.
It is the standard config format for several major developer tools: Cargo.toml drives every Rust project, pyproject.toml is the modern standard for Python packaging, and it appears in Hugo, Jekyll and many other tools' settings.
Being plain text, you can open, edit and diff a .toml file in any text editor, and most programming languages have a small library that parses it into native data structures.
What opens a .toml file?
The .toml format opens in the following apps, grouped by operating system. If one app does not work, try another from the same list.
Windows
- VS Code
- Notepad++
- any editor
macOS
- VS Code
- any editor
Linux
- VS Code
- nano
- any editor
Web
- Online TOML validators
Open a .toml file step by step
- Confirm the file really is a .toml. Drop it into the WhatFileType identifier, which reads its signature in your browser without uploading anything.
- On Windows, open it with VS Code or Notepad++.
- On Mac, use VS Code or any editor.
- On Linux, try VS Code or nano.
- Still stuck? Convert the .toml to JSON, which opens more widely.
Why can't I open my .toml file?
Almost always because no installed app understands TOML. Install one of the apps above, or convert the file to a format your existing software already reads. If double-clicking opens the wrong program instead of nothing at all, the file association is set to the wrong app rather than the file being broken.
The other possibility is that the file is not really a .toml at all. Drop it into the file identifier to check it by its bytes instead of its name. Nothing is uploaded.
How to convert a .toml file
You can convert a .toml file to JSON, YAML using a conversion tool or the export menu of an app that opens it.
TOML has no fixed magic number, so there is no signature table on this page. Its bytes alone do not prove the format: identification relies on the extension, the structure of the content and the program that created it. The magic-numbers reference lists the formats that do carry one.
Frequently asked questions
What is a .toml file?
TOML is a plain-text configuration file format designed to be obvious to read, using key = value lines under [section] headers instead of YAML's whitespace rules or JSON's brackets. It is the standard config format for Rust's Cargo and modern Python packaging, among many other developer tools.
Is TOML better than YAML?
Neither is strictly better. TOML trades some of YAML's flexibility for a stricter, more explicit syntax that is harder to get subtly wrong, which is why tools like Cargo for Rust and modern Python packaging chose it.
How do I open a .toml file?
Any plain-text editor works, and most code editors add syntax highlighting for it. Programming languages typically have a small TOML library to load it directly into your code.
Related formats
Sources
Details on this page were checked against authoritative references. How sources are ranked and what is deliberately left out is set out in the methodology.