Convert TOML config files to pretty JSON and JSON back to TOML, with tables, arrays of tables and dates. Parse errors show the line number, entirely in your browser.
Updated
/ 5 - Be the first to rate this tool Thanks for rating!
Verification failed - please try again.
Quick check
Please verify you're not a robot to submit your rating.
Give feedback
Tell us what you think about Convert TOML to JSON and JSON to TOML.
- Runs entirely in your browser — your data is never sent to a server
- Handles tables, arrays of tables, inline tables and dates
- Parse errors point to the exact line
How it works
-
1
Choose TOML to JSON or JSON to TOML.
-
2
Paste your TOML or JSON.
-
3
Fix any line-numbered error that appears.
-
4
Copy the converted output.
About the TOML ↔ JSON
TOML is the config format behind Cargo.toml, pyproject.toml and many other tools, while most code and APIs speak JSON. This converter parses TOML into formatted JSON and writes JSON back as TOML. Its parser handles tables, arrays of tables, inline tables, multi-line strings and typed numbers, and reports errors with the line number where parsing stopped.
What you can do
- Convert TOML to indented JSON, or JSON to TOML, as you type.
- Parse [table] and [[array of tables]] headers, dotted keys and inline tables.
- Read basic, literal and multi-line strings with their escapes, and hex, octal and binary integers with underscores.
- Get errors such as a duplicated key or table, with the line it happened on.
- Switch direction and the last good output becomes the new input.
When it works best
- Reading a pyproject.toml or Cargo.toml from a script that only understands JSON.
- Turning a JSON settings object into TOML for a tool such as Hugo, Netlify or a Rust app.
- Finding the exact line of a syntax error in a TOML config file.
Things to know
- Parsing and conversion run in your browser.
- Dates and times are kept as strings in JSON, since JSON has no date type, and inf or nan values are rejected.
- JSON to TOML needs an object at the root and cannot convert null. Comments are lost when converting from TOML.
- For YAML configs use YAML ↔ JSON, and for environment files use .env ↔ JSON.
Frequently asked questions
They become strings in JSON, which has no date type.
The root must be an object, and null values cannot be expressed in TOML.
No, comments are lost when converting from TOML.
With the line number where parsing stopped, for problems such as a duplicated key or table.