TOML to JSON Converter
Parse TOML documents and convert to formatted JSON output with validation and error reporting.
TOML to JSON Converter tool
Example
Input: title = "App" / [server] / port = 8080
Result: A 2-space indented JSON object: { "title": "App", "server": { "port": 8080 } }
The [server] table becomes a nested object. Integers and booleans keep their types, and TOML dates become ISO date strings.
How TOML Values Appear in JSON
| TOML | JSON |
|---|---|
| a = "x" | {"a": "x"} |
| a = 'C:\path' | {"a": "C:\\path"} |
| a = 1_000 | {"a": 1000} |
| a = 0x1F | {"a": 31} |
| a = inf | {"a": null} |
| a = 2024-01-15T10:30:00Z | {"a": "2024-01-15T10:30:00.000Z"} |
| a = 2024-01-15T10:30:00 | {"a": "2024-01-15T10:30:00.000"} |
| a = 2024-01-15 | {"a": "2024-01-15"} |
| a = 10:30:00 | {"a": "10:30:00.000"} |
| a = { b = 1 } | {"a": {"b": 1}} |
| a.b = 1 | {"a": {"b": 1}} |
| [[a]] then b = 1 | {"a": [{"b": 1}]} |
Output of this converter.
- Paste your TOML configuration content into the input area on the left side.
- The parser validates TOML syntax and reports any errors such as duplicate keys or malformed values.
- Review the converted JSON output with proper indentation and type mapping in the right panel.
- Verify that TOML tables, arrays of tables, and datetime values are correctly represented in JSON.
- Click the copy button to copy the formatted JSON for programmatic processing or API consumption.
Reading TOML Files as JSON
This tool parses a TOML file and prints the same data as JSON with 2-space indentation. A [server] section holding port = 8080 becomes "server": { "port": 8080 }, ready for a script, an API or a JSON Schema check. The parser follows TOML 1.0 and is strict. Duplicate keys, a table defined twice or a badly written value stop the conversion with an error message. Comments are dropped. Dotted keys like a.b = 1, inline tables like a = { b = 1 } and [[array]] tables all become nested JSON objects and arrays.
TOML has more types than JSON, so a few values change form. Integers written as 1_000 or 0x1F become plain numbers, 1000 and 31. Dates and times become strings. An offset date-time gets milliseconds added, so 2024-01-15T10:30:00Z becomes "2024-01-15T10:30:00.000Z". A local date stays "2024-01-15", and a local time such as 10:30:00 becomes "10:30:00.000". The special floats inf and nan have no JSON form and come out as null. The table lists each case.
The conversion also runs the other way, from JSON back to TOML. To move the config into a YAML-based tool instead, use the TOML to YAML Converter, and to explore the JSON as a tree, the JSON Formatter.
Sources
Frequently Asked Questions
Related Tools
JSON to TOML Converter
Convert JSON objects to TOML format with type preservation and clean table structure output.
Developer ToolsJSON Formatter and Validator
Format, validate, beautify, and minify JSON data with a collapsible tree view and line-and-column error detection.
Developer ToolsTOML to YAML Converter
Convert TOML configuration files to YAML format seamlessly with structure preservation.
Developer ToolsYAML to JSON Converter
Parse YAML documents and convert to formatted JSON with error reporting and syntax validation.
Developer Tools