TOML Formatter

Format and validate TOML (Tom's Obvious, Minimal Language). Neatly aligns key = value pairs, tables, and arrays, and reports syntax errors with line numbers.

Main TOML Data Types

Type Example Description
String (basic) "hello" Enclosed in double quotes. Supports escape sequences such as \n and \t.
String (literal) 'C:\path' Enclosed in single quotes. No escaping is applied at all, making it convenient for paths containing backslashes.
Integer 42 Decimal by default; also supports 0x (hex), 0o (octal), 0b (binary), and underscore separators like 1_000.
Float 3.14 Exponential notation (1e10) and special values inf/nan are also valid.
Boolean true Either true or false. Capitalized forms like True are invalid.
Array [1, 2, 3] Comma-separated values inside square brackets. A trailing comma is allowed.
Table [server] Every key = value pair following a section header becomes a child of that table.
Array of tables [[fruits-basket]] Repeating the same table name expresses an array (e.g. multiple dependency definitions).
Date/Time 1979-05-27T07:32:00Z RFC 3339 format — the only compound value that can be written without quotes.

Formatting and checking TOML

TOML is a format designed for configuration files, and its appeal lies in the plainness of simply listing `key = value` pairs. This tool tidies up the TOML you paste in and, at the same time, judges whether the syntax holds together. When something is broken, the offending line is named.

**The first thing people trip over in TOML is that structure comes from heading lines written `[table]`, not from indentation.** Anyone used to YAML will reach for indentation to express hierarchy, but in TOML indentation carries no meaning at all: **the keys written between one table heading and the next belong to that table.** The position of a line is therefore what determines the structure. The other distinctive feature is that dates and times are first-class types, so a value like `2026-09-20T10:00:00Z` can be written unquoted, exactly as it stands.

How to use it

  1. Paste the TOML The contents of a `Cargo.toml` or a `pyproject.toml` can go in as they are.
  2. Check the verdict **Sound input is marked as valid TOML; where the syntax fails, the line in question is pointed out.**
  3. Read the formatted output Keys and values line up, and the boundaries between tables become easy to see.
  4. Copy it back out The tidied contents can be returned to the file unchanged.

Tips for getting more out of it

  • Only single-line inline arrays and inline tables are supported. If your array spans multiple lines, collapse it into one line before pasting.
  • The formatter always normalizes exactly one space on each side of "=", and standardizes array/inline table separators to ", ". This smooths out inconsistent formatting between authors.
  • Comments (everything after #) are preserved; the only change applied is inserting a single space right after "#" when missing, keeping the edit minimal.
  • Consecutive blank lines are collapsed into a single blank line, making the boundaries between tables easier to scan.
  • All processing happens entirely inside your browser — nothing you paste here is ever sent to a server.

Where it comes in useful

Hunting for a mistake in a configuration file

**Misplacing a table heading silently changes which table a key belongs to, and that is a class of error the eye rarely catches.**

Reading project settings in Rust or Python

Formatting a `Cargo.toml` or `pyproject.toml` makes the divisions between dependencies far easier to follow.

Checking something converted from another format

Settings rewritten from JSON or YAML can be tested on the spot for whether the syntax holds.

Keeping a team's style uniform

Formatting before committing keeps stray whitespace out of the diff, leaving only the changes that matter.

TOML terms

Table
A heading written in square brackets, such as `[package]`, which **gathers the keys from there to the next heading into one group.**
Array of tables
The notation written with doubled brackets, `[[dependencies]]`. Repeating the same heading adds another element to the array.
Inline table
A table written on one line as `{ a = 1, b = 2 }`. **It suits short settings but cannot be broken across lines.**
Basic string
A string in double quotes, within which escapes such as `\n` take effect.
Literal string
A string in single quotes. **No escape has any effect inside it, which makes it the right choice for Windows paths and regular expressions.**
Datetime
A type TOML provides natively. A date or time such as `1979-05-27T07:32:00Z` can be written without quotes.

Frequently Asked Questions

TOML tends to work well for flat-ish, key-value-heavy files edited by multiple people (like dependency manifests), since indentation mistakes rarely break anything. YAML is usually the better choice when you need deeply nested structures or multiple documents in one file.

It formats each [[section]] header correctly, but it does not merge repeated same-name sections into a single array-like object (as a full TOML-to-JSON converter would). For complex array-of-tables structures, please review the line-by-line formatted output visually.

The tool recognizes RFC 3339 syntax and passes the value through unchanged, but it does not validate calendar correctness (e.g. catching "February 30"). If strict date validation matters for your use case, verify it separately.

"""...""" and '''...''' are not currently supported, and that line will be reported as an error. Please convert long text into a single-line escaped string before formatting.

No. All formatting runs entirely in your browser via JavaScript — nothing is ever sent to or stored on a server, so it is safe to use even with config files that contain credentials.
Tool-kun

Side Note — Why TOML became the common language of config files

TOML was created in 2013 by GitHub co-founder Tom Preston-Werner, and its expanded name, "Tom's Obvious, Minimal Language", captures the design goal directly: a format that is easy for machines to parse like JSON, yet reads and writes naturally for humans without ambiguity.

The format's breakthrough moment came when Rust's package manager Cargo adopted Cargo.toml as its manifest format. Later, PEP 518 introduced pyproject.toml as Python's packaging standard, consolidating what had been a patchwork of setup.py, setup.cfg, and requirements.txt files.

The biggest difference from YAML is that TOML gives no meaning to indentation. In YAML, a small indentation slip can silently change the data structure or trigger a syntax error; TOML instead expresses hierarchy purely through [section] headers and key = value pairs, which makes copy-paste mistakes far less likely.

That said, TOML trades away some of YAML's expressive power — it has no anchors/aliases for reusing values and is more verbose for deeply nested structures, so many teams pick between TOML, YAML, and JSON depending on the shape of the data.