Advertisement728 × 90 — Leaderboard
Advertisement320 × 50 — Mobile banner

Convert TOML to JSON

Convert TOML configuration files to JSON instantly
Session restored from your last visit
Also need:TOML FormatterYAML to JSONJSON Formatter
Advertisement — Fullscreen
Input
Output
Input
AdvertisementResponsive
Output
Copy as JSON
Copy Escaped
Copy as Base64
Copy as cURL
Ready0 chars0 lines
Advertisement728 × 90

About Convert TOML to JSON

Paste any TOML configuration file and instantly get a clean JSON output. Tables become JSON objects, arrays of tables become JSON arrays, and all TOML types (integers, floats, booleans, datetimes) are mapped to their JSON equivalents. Datetime values are converted to ISO 8601 strings.

Frequently Asked Questions

What is TOML to JSON conversion?
TOML to JSON conversion parses a TOML configuration file and serialises it as JSON. TOML tables become JSON objects, arrays of tables become JSON arrays of objects, and scalar values map to their JSON equivalents. JSON is easier to consume in most programming languages.
Does converting TOML to JSON preserve datetime types?
TOML datetimes (RFC 3339) have no native equivalent in JSON. They are serialised as strings in the output, preserving the timestamp value but losing the type distinction. When converting back to TOML, the string would need to be explicitly re-typed as a datetime.
What happens to TOML comments when converting to JSON?
TOML comments are discarded. JSON has no comment syntax, so there is nowhere to put them. Keep the TOML source file as the documented version and generate JSON from it programmatically as part of your build process.
Can I convert TOML to JSON in Python or Rust without this tool?
Python: import tomllib (stdlib since 3.11), json; print(json.dumps(tomllib.loads(toml_string), indent=2)). Python 3.10 and earlier: pip install tomli. Rust: add toml = "0.8" to Cargo.toml; serde_json::to_string_pretty(&toml::from_str::<serde_json::Value>(&toml_string).unwrap()).
What TOML v1.0 features does the converter support?
The converter supports all TOML v1.0 features: string types (basic, literal, multi-line), integers (decimal, hex, octal, binary), floats (including inf and nan), booleans, offset datetimes, local datetimes, local dates, local times, arrays, inline tables, and array-of-tables. TOML v1.1 (draft) extensions like newlines in inline tables are not yet supported.
Advertisement300 × 250
Advertisement300 × 250
Ad
AdvertisementSticky banner
Ad
AdvertisementSticky banner