TOML → JSON

Converts TOML configuration into JSON.

TOML to JSON converts TOML configuration into JSON, parsing your input and returning pretty-printed JSON with 2-space indentation. It's handy when you need to feed a TOML config file into a tool or API that expects JSON, or simply to inspect a TOML document's structure. Like every tool on codedev.tools, the conversion runs entirely in your browser.

Common uses

  • Convert a Cargo.toml, pyproject.toml, or other config file into JSON for inspection
  • Translate TOML settings into JSON to feed tools or APIs that only accept JSON
  • Quickly check how TOML tables, arrays, and nested values map to JSON structures
  • Generate JSON fixtures or test data from a TOML source
  • Validate that a TOML file parses correctly before using it elsewhere

FAQ

Is my data sent to a server?

No. The conversion runs entirely in your browser using JavaScript, and nothing you paste is uploaded or stored on any server.

What does the JSON output look like?

The output is pretty-printed JSON indented with 2 spaces, reflecting the tables, arrays, and key-value pairs from your TOML input.

How are TOML dates and times handled?

The parser follows the TOML specification, so offset and local date-time, date, and time values are recognized as TOML's native types and serialized to JSON as strings.

What happens if my TOML is invalid?

If the input can't be parsed as valid TOML, the parser throws an error rather than producing output, so you'll know the document needs fixing.

Which TOML version is supported?

Parsing is handled by the smol-toml library, which targets the TOML 1.0 specification, including nested tables, arrays of tables, and inline tables.

Related tools

  • JSON → TOML
  • JSON → YAML
  • TOML Formatter
  • TOML → YAML
  • YAML Formatter
  • YAML → JSON
  • YAML → TOML
  • YAML Validator