Skip to content

TOML to JSON

Convert a TOML config to JSON, with tables and arrays of tables resolved.

Quick Tool Overview

The TOML to JSON converter resolves dotted table headers into real nesting and arrays of tables into arrays of objects, which makes TOML's scoping — the thing people get wrong — immediately visible.

What it does
Converts TOML into JSON
You give it
Any TOML configuration file
You get back
Formatted JSON with the real nesting resolved
Best for
Reading Cargo.toml, pyproject.toml and site configs
Developer Tools Free, unlimited use No sign-up Runs in your browser

About the TOML to JSON

Converting a TOML file to JSON shows you the structure it actually describes rather than the one the headers suggest. Dotted table headers become real nesting, arrays of tables become arrays of objects, and every key ends up where TOML says it belongs.

That is more useful than it sounds, because TOML's scoping is the thing people get wrong. A key written below a [table] header belongs to that table even if the author meant it as a top-level setting, and the JSON makes that immediately visible. The parser handles basic and literal strings, multi-line strings, integers in decimal, hex, octal and binary, floats, booleans, dates, arrays and inline tables.

Key features of the TOML to JSON

Scoping made obvious

A setting that ended up inside a table rather than at the root is plain to see once the headers become nesting.

Every integer form

Decimal, hex, octal and binary literals all convert, and underscore separators such as 1_000_000 are handled.

Inline tables and arrays

The { x = 1 } and [1, 2] forms are read, including across the line breaks a long array is wrapped over.

Dates stay as written

JSON has no date type, so a TOML date is kept as its original string rather than being reinterpreted into a timestamp.

Errors by line

A file that will not parse names the line, which for a Cargo.toml is usually a missing quote.

How to use the TOML to JSON

  1. 1

    Paste your TOML

    Cargo.toml, pyproject.toml, a Netlify or Hugo config, or your own.

  2. 2

    Read the JSON

    Table headers become nesting, so you can see what belongs to what.

  3. 3

    Check the scoping

    A setting that ended up inside a table rather than at the root is obvious here.

  4. 4

    Copy or download

    Take the JSON to your clipboard or save it as a .json file.

Frequently asked questions

TOML has real date, time and datetime types and JSON has none, so they are kept as strings in their original form rather than being reinterpreted into a timestamp.

Reviews of the TOML to JSON

What people who use the TOML to JSON think of it. Reviews come from visitors and are posted as written.

No ratings yet

Yours would be the first.

  • 5 0 reviews rated 5 stars
  • 4 0 reviews rated 4 stars
  • 3 0 reviews rated 3 stars
  • 2 0 reviews rated 2 stars
  • 1 0 reviews rated 1 star

Write a review

Used this tool? Your rating helps the next person decide.

Your rating

Plain text only — links, email addresses and HTML are not accepted. Your name and review are shown publicly; nothing else is collected. See the privacy policy.

0 reviews

Newest first

No reviews yet

Be the first to rate the TOML to JSON. It takes half a minute and no account.

Write the first review

More developer tools