Skip to content
Tezmy Tools

TOML to JSON Converter

Convert TOML config files to JSON and back

Dates and times are kept as text, because JSON has no date type.

Runs in your browser. Nothing is uploaded.

About the TOML to JSON Converter

TOML is a friendly configuration format used by Rust's Cargo, Python's pyproject.toml, Hugo and many other tools. JSON is what most code and APIs speak. This converter reads TOML and writes JSON, and it can also turn JSON back into TOML. It understands tables, nested and dotted keys, arrays of tables, inline tables, strings of every kind including multi-line ones, integers, floats, booleans and dates. When something is wrong it tells you the line number and what it did not understand. Dates stay as text in the JSON because JSON has no date type. The conversion runs in your browser, so your configuration files stay private.

Updated October 2026

How to use the TOML to JSON Converter

  1. 1Choose TOML to JSON or JSON to TOML.
  2. 2Paste your text on the left.
  3. 3Pick the JSON indent: 2 spaces, 4 spaces or minified.
  4. 4Read the result on the right, or the error with its line number.
  5. 5Copy it or download the file.

How TOML maps to JSON

A top-level key = value pair becomes a property of the root object. A [table] header starts a nested object, and [a.b] nests it two levels deep. Dotted keys such as a.b.c = 1 do the same in one line. Arrays of tables, written [[products]], produce a JSON array of objects.

Numbers keep their meaning: underscores are removed from 1_000, hex like 0xFF becomes 255, and inf or nan are written as strings because JSON has no such numbers.

Comments are the one thing that does not survive. TOML lets you annotate a setting with a note, but JSON has no place for notes, so they are dropped. Key order is kept as written, which makes diffs easy to read. If your file uses very large integers beyond 15 digits, check them in the output, because JSON numbers lose precision there.

Common mistakes the tool catches

  • A key defined twice in the same table.
  • A string that is missing its closing quote.
  • A value that is not a number, string, boolean, date, array or table.
  • A table header that is missing its closing bracket.
  • Text left over after a value on the same line.

Related tools

If your file is YAML, use the YAML to JSON Converter, and for the reverse direction try the JSON to YAML Converter. After converting, check the result with the JSON Validator and tidy it with the JSON Formatter. Settings stored as environment variables can be handled by the Env to JSON Converter.

Features

  • TOML to JSON and JSON to TOML
  • Tables, dotted keys and arrays of tables
  • Inline tables and arrays, including multi-line
  • Basic, literal and multi-line strings
  • Integers in hex, octal and binary; floats
  • Line numbers in error messages
  • Private, runs in your browser

Frequently asked questions

What is TOML?

Tom's Obvious Minimal Language is a configuration file format with clear key = value lines, [tables] and comments starting with #.

Why are my dates strings in the JSON?

JSON has no date type, so dates and times are written as text in ISO format, like 1979-05-27T07:32:00-08:00.

How are arrays of tables converted?

Each [[name]] block becomes one object in an array called name.

What if the TOML has an error?

The tool shows the line number and a short reason, such as a key defined twice or a string that was not closed.

Does JSON to TOML keep everything?

Objects become tables, lists of objects become arrays of tables and other lists become arrays. Nulls have no TOML equivalent and are written as empty strings.

Does TOML allow comments?

Yes, with #. Comments are dropped when converting to JSON, since JSON cannot hold them.

Can I convert pyproject.toml or Cargo.toml?

Yes. Paste the file and you get the same data as JSON, which is handy for scripts and checks.

Related tools