Ready to format
Paste TOML and click Format// format and validate toml in one click
Format, beautify, and validate TOML files instantly in your browser. Detects syntax errors, normalizes indentation, and exports clean TOML. Free, no sign-up.
Ready to format
Paste TOML and click FormatCopy your TOML content into the input panel on the left, or click Sample to load an example.
Select your preferred indentation (2 spaces, 4 spaces, or tabs) and output format (TOML or JSON).
Click Format TOML to beautify. Copy the result or download it as a file.
TOML Formatter is a free, browser-based tool that parses and beautifies TOML (Tom's Obvious, Minimal Language) files. It validates syntax, normalizes indentation, and optionally converts your TOML to JSON — all without uploading your data to any server.
TOML (Tom's Obvious, Minimal Language) is a configuration file format designed to be easy to read due to its obvious semantics. It maps unambiguously to a hash table and is used in projects like Rust (Cargo.toml), Hugo, and Python packaging (pyproject.toml).
No. All formatting and validation is performed entirely in your browser using JavaScript. Your TOML data never leaves your device, making this tool safe for sensitive configuration files.
The formatter supports TOML v1.0, which is the current stable specification. This includes all data types: strings, integers, floats, booleans, datetimes, arrays, and inline tables.
Yes. Select "JSON" in the Output options before clicking Format. The tool will parse your TOML and produce equivalent JSON output, which you can copy or download.
Common TOML errors include duplicate keys, incorrect datetime formats (must be RFC 3339), unquoted strings, and mixed-type arrays. The error message will indicate the line and column where the issue was detected.
TOML is designed for configuration files and has simpler, more explicit syntax with less ambiguity than YAML. YAML supports more complex data structures and is more common in CI/CD pipelines. TOML is often preferred for project config files due to its readability.
A TOML Formatter is a developer utility that takes raw or poorly formatted TOML (Tom's Obvious, Minimal Language) content and outputs a clean, consistently indented, human-readable version. Beyond simple beautification, a good TOML formatter also performs syntax validation — catching errors like duplicate keys, malformed dates, or type mismatches before they cause runtime problems in your application.
Our TOML Formatter runs entirely in the browser. No data is ever sent to a remote server, which makes it suitable for formatting private configuration files containing database credentials, API keys, or other sensitive values.
TOML stands for "Tom's Obvious, Minimal Language." It was created by Tom Preston-Werner (co-founder of GitHub) in 2013 with the explicit goal of being a configuration file format that is easy to read and write for humans while mapping unambiguously to a standard hash table (dictionary) data structure.
TOML is now widely used across many ecosystems. Rust developers encounter it daily through Cargo.toml, the manifest file for Rust packages. Python developers use it via pyproject.toml for project metadata and build configuration. The Hugo static site generator uses TOML for site configuration. The Gitea and Forgejo source code forging platforms use TOML config files. TOML is also used in many CI/CD tools and infrastructure-as-code tooling.
Understanding TOML's type system is key to writing and debugging valid TOML files. The specification defines these core types:
"hello"). Literal strings use single quotes and treat backslashes literally ('C:\Users\foo'). Multi-line variants exist for both.0xFF), octal (0o77), and binary (0b1010) integer literals are all valid. Underscores can be used as visual separators: 1_000_000.inf, -inf, and nan.true or false, always lowercase.1979-05-27T07:32:00Z.1979-05-27T07:32:00.1979-05-27.07:32:00.point = { x = 1, y = 2 }.Tables are TOML's primary way to group related key-value pairs. A table header is denoted with square brackets:
[database]
host = "localhost"
port = 5432
Array of Tables (AoT) use double square brackets and allow you to define multiple table instances with the same name — similar to a list of objects in JSON:
[[products]]
name = "Widget A"
price = 9.99
[[products]]
name = "Widget B"
price = 14.99
This pattern is especially common in CI configuration files and documentation generators where you need to repeat a structured block.
These are the most frequent problems our formatter detects and corrects:
{ key = "value" }) and others are block style. The formatter can normalize these to your preferred style.2024/01/15) instead of hyphens, or omitting the time separator.One of the most useful features of this tool is TOML-to-JSON conversion. Many APIs, web services, and JavaScript tools work natively with JSON, so being able to convert your TOML configuration to JSON allows you to use the same data in different contexts without rewriting it manually.
When converting, the tool preserves all value types as accurately as possible within JSON's type system. Note that TOML datetimes, which have no direct JSON equivalent, are serialized as ISO 8601 strings. TOML integers and floats become JSON numbers. TOML arrays become JSON arrays, and TOML tables become JSON objects.
TOML is best for human-written configuration files where readability and explicit typing matter. Its unambiguous parsing rules make it less error-prone than YAML for config files that developers edit by hand.
YAML excels in scenarios that require complex, deeply nested data structures or where the format must be highly compact. It is ubiquitous in Kubernetes manifests, GitHub Actions workflows, and Ansible playbooks. However, YAML's flexibility comes at the cost of parsing ambiguity (e.g., the famous Norway problem where NO is parsed as false).
JSON is the standard for data interchange between systems and APIs. It is less readable than TOML or YAML for human-maintained files but is universally supported and unambiguous. JSON does not support comments, which makes it less suitable for configuration files that developers need to annotate.
For project configuration files that developers write and maintain by hand, TOML is increasingly the preferred choice due to its clarity and strong typing. For machine-generated or machine-consumed data, JSON remains the default.
While command-line tools like taplo offer powerful TOML formatting capabilities, a browser-based formatter is often more convenient for quick tasks. You do not need to install anything, configure a linter, or set up a project. Simply paste your TOML, click Format, and copy the result. This is particularly useful when you are working on a new machine, pair programming, or need to quickly check a snippet from a code review.
Our tool is completely free, requires no account or sign-up, and processes all data locally in your browser. It is suitable for everyday use by frontend developers, DevOps engineers, Rust developers, and anyone who works with TOML configuration files.