Use pasted TOML or a file
Paste TOML into the text area or load a .toml or .txt file. The converter keeps tables, inline tables, arrays of tables, dotted keys, and quoted keys in the resulting JSON structure. It reports parse errors with a line and column, and marks date and time values with their TOML type.
- Paste TOML into the text area, click
browse filesto choose a.tomlor.txtfile, or drop it onDrop a TOML file here. - Choose
Output format.Pretty (indented)keeps line breaks;Compact (minified)removes formatting whitespace. - For pretty output, set
Indent sizeto2 spaces,4 spaces, orTab. - Read
JSON outputand the conversion notes. The converter processes valid input automatically and shows a line and column for a parse error. - Click
Copy JSONorDownload JSONto take the result to another file or tool. - Click
Clearto remove the input, output, options, and error message.
What TOML structure becomes
A table header such as [user] creates an object. An array-of-tables header such as [[servers]] adds objects to an array. Dotted keys create nested properties, quoted keys stay literal, and inline tables must stay on one line.
[user]
name = "Alice"
With Compact (minified) selected, the sample becomes:
{"user":{"name":"Alice"}}
The parser reads booleans, decimal, hexadecimal, octal, and binary integers, floats, strings, and arrays. Arrays may contain mixed value types.
How special TOML values appear in JSON
Date-times, dates, and times become tagged objects because JSON has no native date/time type. For example, 1979-05-27T07:32:00-08:00 becomes { "$tomlType": "offset-datetime", "value": "1979-05-27T07:32:00-08:00" }. The warning banner lists each distinct conversion note. inf and nan also become tagged float objects.
Integers become JavaScript Number values. An integer beyond safe JSON precision, 2^53, may lose accuracy and produces a warning. Check those values before relying on exact integers in the output.
What a TOML parse error shows
An invalid value keeps JSON output hidden and displays the parser message with a line and column. The parser reports issues such as unterminated strings, duplicate keys, malformed table headers, and inline tables that span multiple lines. You must correct the TOML before JSON output appears.
What happens with a large uploaded file
When a selected file is longer than 200,000 characters, the text area shows a shortened preview with a truncation note. The full file is still processed. File reading, parsing, and JSON construction happen in the browser, and the page does not send the file contents in a network request.
The result can be copied with Copy JSON or saved with Download JSON. The download uses the filename converted.json.
Choose another config converter
Use the Config File Convert Tools category for another configuration conversion. For YAML input, use the YAML to JSON Converter.
Frequently asked questions
Can I convert a TOML file to JSON?
Yes. Click browse files or drop a file on Drop a TOML file here. The accepted file types are .toml and .txt.
How do I format TOML to JSON with two spaces?
Choose Pretty (indented) under Output format, then choose 2 spaces under Indent size. JSON output refreshes when the setting changes.
How does TOML to JSON handle dates and times?
Each date or time becomes a tagged object containing its TOML type and original value. A conversion note appears above JSON output.
Where does the TOML parser show an error?
The parser message includes the line and column where the problem was found. JSON output stays hidden until the input parses successfully.