Productivity and Utilities

TOML JSON Converter

Convert a TOML document to JSON, or a JSON object to TOML, with clear errors.

Up to 1,000,000 characters. Read in this tab and never uploaded.

Reads TOML 1.0, including tables, arrays of tables, inline tables, dotted keys and all four string forms. Date and time values become JSON text exactly as written, because JSON has no date type. Not supported, with a clear error instead of a guess: integers beyond 2^53 (JSON would lose digits) and the values inf and nan (JSON has none). JSON to TOML needs an object at the top level, cannot hold null, and writes whole numbers as integers.

Next step

How to use the toml json converter

  1. Choose TOML to JSON or JSON to TOML. A sample is loaded for each direction.
  2. Paste your document into the first box. It is checked as you type.
  3. For JSON output, choose a 2 space, 4 space or minified layout.
  4. Read any error, which names the line and column, then copy or download the result. Use Use result as input to go back the other way.

A small config both ways

The line name = "x" in TOML becomes {"name": "x"} in JSON. A table written as [server] with ports = [8000, 8001] becomes an object with a key server that holds a list of two numbers.

Going the other way, {"title": "Example", "owner": {"name": "Ann"}} becomes title = "Example" followed by a blank line, a [owner] header and name = "Ann". Plain values are written first and tables after them, which is how TOML requires it.

What is supported

The reader follows the TOML 1.0 grammar: comments, bare and quoted keys, dotted keys, basic and literal strings in single and multi-line form with all escape sequences, integers in decimal, hex, octal and binary with underscores, floats, booleans, arrays that span lines, inline tables, standard tables and arrays of tables. It reports the errors the specification requires, such as a key defined twice, a table defined twice, or an attempt to extend an inline table.

Date and time values have no JSON equivalent, so they are written to JSON as text exactly as you typed them, and the status line counts them. A date such as 1979-05-27 and a time such as 07:32:00 are checked for real calendar and clock values first, so 2023-02-30 is an error.

What is not supported, and why

Two kinds of TOML value cannot be written to JSON without changing them. Integers beyond 2^53, which JSON numbers cannot hold exactly, stop the conversion with an error that names the value. The floats inf and nan have no JSON form and also stop with an error. The tool never rounds or guesses.

In the other direction the JSON must be an object at the top level, because a TOML document is a table. A null value is an error since TOML has no null, and a JSON number such as 1.0 is written as the integer 1 because JSON does not keep the difference. Text strings that look like dates stay quoted strings.

Privacy and size

Everything runs in your browser and nothing is uploaded. Input is limited to 1,000,000 characters and 100 levels of nesting. For more JSON work see the JSON formatter and validator, the JSON viewer and the JSON to TypeScript tool.

Assumptions and limits

  • The TOML grammar used is version 1.0. Features added in later versions are not read.
  • TOML dates and times become JSON text unchanged. No time zone is added or removed.
  • Integers larger than 9,007,199,254,740,991 in size, inf and nan are errors, not approximations.
  • JSON to TOML needs an object at the top level and does not accept null values.

Formulas reviewed October 10, 2026. See the calculation methodology for how SumPanda rounds, tests and sources its formulas.

Frequently asked questions

Does the converter keep the order of my keys?

Yes. Keys keep the order they were written in. When writing TOML, plain values come first and tables and arrays of tables follow, as the format requires.

Why did my date become a string in JSON?

JSON has no date type, so a TOML date or time is written as the same text, for example 1979-05-27T07:32:00-08:00. Your own code can parse it after loading.

Can I convert comments?

No. Comments are part of the TOML text only, and JSON has no place for them, so they are dropped when you convert to JSON.

What does an array of tables look like in JSON?

A TOML header written as [[products]] repeated twice becomes a key products holding a list of two objects, one for each block.