TOML to JSON — Guide

Parse and convert TOML to JSON.

What it is and when to use it

TOML is a favourite for application config because it is human-editable and maps onto a clean data structure, but most code and APIs speak JSON. This tool parses TOML into its data model and serialises the result as JSON: tables become objects, dotted keys become nested objects, and arrays of tables become JSON arrays. The companion JSON-to-TOML tool handles the other direction, so config can flow from a TOML file into a JSON-based pipeline without manual editing.

Converts TOML configuration into JSON, so it can be consumed in code or over an API.

How to use it

  1. Paste the TOML
  2. Get the JSON result
  3. Copy and use it

A worked example

Fill in sample TOML

title = "demo"

[server]
port = 8080

Copy this into the tool, or open TOML to JSON

Questions people ask

Are TOML tables the same as JSON objects?
Effectively yes. A [server] table with port = 8080 becomes { "server": { "port": 8080 } }, and a dotted key server.port = 8080 produces the same structure. Arrays of tables ([[items]]) become JSON arrays of objects.
What about TOML types JSON lacks?
TOML has datetimes (local, zoned and offset) that JSON cannot represent natively. They are serialised as ISO-8601 strings so the value survives the conversion; if you need them as real dates on the other side, parse the string explicitly.
Is the conversion lossless?
For the data model, yes — nothing is dropped. The only loss is TOML-specific niceties like comments and key ordering in some serialisers; the values themselves come through unchanged.

Next steps

Open the TOML to JSON tool

Spotted something wrong on this page? Tell us via Contact Us