Toolstia / TOML to JSON converter
TOML to JSON converter
Paste a TOML file and get the equivalent JSON straight away. It is handy for Cargo.toml, pyproject.toml, Hugo and other config files when a tool or API wants JSON instead.
Supports TOML 1.0 tables, arrays of tables, inline tables, dotted keys, all string types, hex, octal and binary numbers, and comments. Dates and times are kept as text because JSON has no date type. Very large integers above 9007199254740991 lose precision.
How it works
- Paste your TOML into the box.
- Choose how the JSON should be indented.
- Copy the JSON, or fix the line the error message points to.
What is supported
Tables, nested tables, arrays of tables, inline tables, dotted and quoted keys, basic and literal strings (including multi-line), integers in decimal, hex, octal and binary, floats, booleans and comments.
Dates and times
JSON has no date type, so TOML dates and times are kept as text exactly as written, for example 1979-05-27T07:32:00Z.
Clear errors
If the file is invalid, for example a key is defined twice or a string is never closed, the tool shows the line number and the problem.
Number limits
Integers above 9007199254740991 lose precision in JavaScript. Infinity and NaN cannot exist in JSON, so they are written as the text inf, -inf and nan.
Questions
Is my config uploaded?
Everything happens in your browser, and nothing you enter is sent anywhere.
Does it follow the TOML 1.0 rules?
Yes. It rejects the same mistakes as a standard parser, such as duplicate keys and redefined tables.
Can I convert JSON to TOML?
Not with this tool. It only converts TOML to JSON.