Skip to content

Parse TOML documents and convert sections, tables, and key-value pairs into valid JSON.

Loading tool

About TOML to JSON

Parse a TOML document and convert it to JSON. Tables, inline tables, arrays of tables and dates are supported; TOML dates and times are written as ISO 8601 strings. Choose 2 or 4 space indentation or minified output and optionally sort keys. Parse errors show the line and column, and inf or nan values, which JSON cannot represent, are written as null with a note.

Common uses

  • Read a Cargo.toml or pyproject.toml file from a JavaScript tool
  • Validate TOML syntax and find the line of an error
  • Inspect how nested TOML tables map to a JSON object

FAQ

How are TOML dates converted to JSON?
JSON has no date type, so TOML date and datetime values are converted to ISO 8601 strings.
What does [[double brackets]] mean in TOML?
Double brackets define an array of tables. Each [[name]] block adds a new object to the JSON array stored under name.
Does the JSON keep my TOML comments?
No. JSON has no comment syntax, so comments are dropped during conversion.