Convert structured TOML configuration to JSON
TOML is a configuration format designed to map clearly to a table. It is used by files such as Rust's Cargo.toml and Python's pyproject.toml. JSON is more common in APIs and JavaScript tooling, so conversion is useful when a TOML-based project needs to feed a JSON-only workflow.
The converter understands TOML 1.1 tables, dotted keys, arrays, inline tables, arrays of tables, strings, numbers, booleans, and date/time values. Syntax problems are reported before output is produced.
Example
title = "MiniUtil"
[database]
ports = [8000, 8001]
enabled = true
becomes:
{
"title": "MiniUtil",
"database": {
"ports": [8000, 8001],
"enabled": true
}
}
Comments and original formatting do not exist in JSON and therefore cannot be preserved. TOML local dates and times are emitted as strings. Integers outside JavaScript's safe integer range are also emitted as strings so their digits are not silently rounded. Special TOML floats such as inf and nan do not have valid JSON number equivalents and are reported as unsupported.
Validation scope and limits
Conversion parses the complete document rather than performing text replacements. Even so, review the destination application's expected types. A JSON consumer may not understand that an ISO-looking string originated as a local TOML date without a timezone.
The input limit is 2 MB. Files must be UTF-8 text. The parser follows TOML 1.1 with documented JavaScript limitations around invalid UTF-8 already decoded by the browser and certain invalid calendar dates.
For other structured data, format output with the JSON Formatter, convert YAML to JSON, or work with line-delimited records in the JSONL Converter.
Privacy and specifications
TOML is parsed locally in the browser and is never uploaded. The implementation uses the maintained smol-toml parser rather than executing configuration as code.
See the official TOML 1.1 specification and the JSON format defined by RFC 8259.