b2KIT

TOML to JSON Converter

Convert between TOML and JSON configuration formats with validation and formatting.

Tested tool guide Tested browser tools Checked August 16, 2026

What TOML to JSON Converter does, with a checked example

Paste a TOML config into one pane and this tool renders the equivalent JSON beside it, and the direction reverses: JSON in, TOML out. Both formats are parsed strictly before anything is converted, so a syntax error stops the run with a message instead of producing garbage, and the output is re-indented to your chosen width. The conversion happens locally in the page, so nothing is uploaded. The common surprise is TOML's date and time values: JSON has no date type, so they come out as ordinary quoted strings.

Worked example

A concrete input and expected output from the current implementation.

Input

title = "inventory"
version = 3
enabled = true
synced = 2024-03-01T12:00:00Z
regions = ["eu", "us", "ap"]

Expected output

{
  "title": "inventory",
  "version": 3,
  "enabled": true,
  "synced": "2024-03-01T12:00:00Z",
  "regions": ["eu", "us", "ap"]
}

Every value maps to its JSON counterpart, with one exception: the TOML datetime has no JSON type, so it is serialized as an ISO 8601 string, identical in form to the TOML literal.

How the result is produced

1

Strict parse before output

Each pane runs a full parser on its input before conversion starts: TOML must satisfy the TOML grammar (keys, values, tables, arrays), and JSON must be well-formed. A failing parse halts the conversion and reports the problem instead of emitting a best-effort result, so the output pane never shows data produced from broken input.

2

Type mapping between formats

Strings, integers, floats, booleans, arrays, and tables map one-to-one, which covers most configuration files. The mismatches are structural: TOML datetimes have no JSON type and serialize as ISO 8601 strings, while JSON null and mixed-type arrays have no valid TOML form, so conversions involving them report an error or drop the value rather than produce invalid TOML.

Good uses

  • Porting a configuration file to a different stack, for example moving a TOML-based service config into a JSON-based deployment or container setup.
  • Cleaning up a hand-edited TOML file: converting to JSON and back forces a full reparse, so duplicate keys, stray syntax, or silent corruption surface as errors instead of failing later at runtime.
  • Feeding a TOML config into a JSON-only tool - a JSON diff, a schema validator, or a formatter - by converting once and pasting the result.

Limits and checks

  • Comments are discarded. TOML comments carry no data, and JSON has no comment syntax, so they never appear in the JSON output and cannot be restored by converting back. Use the tool for values, not as a way to reformat a commented file.
  • Null and mixed-type arrays. JSON values with no TOML equivalent - null, or arrays like ["a", 1] - cannot be converted, because TOML requires homogeneous array elements and has no null. When a JSON-to-TOML run touches these, compare the output with the input before trusting it.
  • Datetime strings look like plain text. After TOML-to-JSON, a date appears as a quoted string such as "2024-03-01T12:00:00Z", and nothing in the JSON marks it as a date. Hand-editing it as text, or converting back, can flip it between a typed date and a string.

Common questions

Will converting back to TOML give me back my original file?

The values will, but not the file. Comments are gone, table layout and blank lines are rebuilt rather than reproduced, and integers written with underscores or hex notation (1_000_000, 0xFF) come back in plain decimal. Treat a round trip as a data migration and diff the result against your original before replacing anything.

Is my configuration uploaded to a server?

No. The conversion runs entirely in the browser on your machine; the text you paste is processed locally and nothing is sent anywhere. That makes it safe to use with configs containing credentials, tokens, or internal hostnames. If you want proof, convert a file while your network is disabled - it still works.

References and verification

The example and behavioral notes were checked against the browser implementation. Standards and primary references below define the relevant format, formula, or platform behavior.

Related Tools