TOML to JSON

Parse and convert TOML to JSON.

Enable JavaScript to use the interactive tool. The guide below explains how it works.

TOML to JSON Converter

What it does

This tool parses a TOML document and outputs the equivalent JSON, indented for readability. If the TOML is invalid, a message explains that it could not be parsed and no output is shown.

Why someone uses it

Step-by-step instructions

  1. Paste your TOML into the left input.
  2. The JSON appears in the right output as soon as the TOML is valid.
  3. Copy the JSON, or fix the highlighted validation error and try again.

Examples

Input:

title = "Example"

[owner]
name = "Sam"

[[servers]]
host = "alpha"
port = 8080

Output (shape): an object with title, an owner object containing name, and a servers array whose first element is { "host": "alpha", "port": 8080 }.

Understanding the results

TOML tables ([owner]) become JSON objects. Arrays of tables ([[servers]]) become JSON arrays of objects. Strings, integers, floats and booleans map directly. TOML has dedicated date and time types, which JSON does not; these are emitted as strings in ISO 8601 form. Comments in the TOML are dropped because JSON has no comment syntax. Key order is preserved as written.

FAQs

Common mistakes

Use cases

Related tools

All tools

Guides and articles