TOML Converter
Convert TOML to JSON and back — verify config files instantly.
What is TOML Converter
This TOML converter translates between TOML and JSON in both directions. Inspect Cargo.toml or pyproject.toml contents as JSON, or generate TOML from JSON. Built on the @iarna/toml library; errors are reported with row details. Everything runs locally in your browser.
🔒 Everything runs in your browser. Nothing is uploaded.
What this tool actually does with your file
- Where it runs
- In your browser, on this page
- Upload
- None — the file never leaves your device
- Offline
- Works with the network disconnected
A configuration format with real types
TOML has actual dates, integers, floats and booleans, unlike INI where everything is a string. A bare 2026-11-26T09:00:00Z parses as a datetime, not as text — useful for config validation, and a surprise when a value that looks like a version (1.10) is read as a float and loses its second dot.
There is no null in TOML: absence of a key is the only way to express nothing. That is a genuine difference from JSON and YAML, and it means a serialiser emitting null has to drop the key, which loses the distinction between 'unset' and 'explicitly empty'.
Table ordering and array-of-tables
Standard tables are declared with [name] and belong to whichever table header precedes them; array-of-tables entries with [[name]] append to a list in file order. Reordering a file can therefore change the meaning, which is why a formatter must preserve document order rather than sorting keys.
Dotted keys and quoted keys interact: a.b = 1 inside [t] defines t.a.b, while "a.b" = 1 defines a key literally named a.b. Getting those confused produces configuration that parses cleanly and is read as something entirely different by the application.
What to check after editing
Duplicate keys are an error in TOML rather than a last-one-wins situation, which is a feature — it catches the merge accident that silently overrides a value in JSON. If a tool accepts duplicates without complaint, it is not following the spec.
Multi-line strings (""" … """) preserve newlines but trim the first one after the opening delimiter, and a trailing backslash removes the following newline. Both details matter for embedded scripts, and both are easy to break with an editor that reindents automatically.
How to use it
- 1.Paste TOML or JSON
- 2.Pick a direction
- 3.Run and copy the result
How TOML Converter works under the hood
Formatters parse your input into a structure, then serialise it back with consistent indentation. That is why a formatter can also reveal a syntax error: if it cannot parse, it cannot print.
- 1
Parse into a tree
JSON goes through JSON.parse; YAML, XML, CSS and SQL use their own parsers. The parse either succeeds with a structure or fails at a line and column.
- 2
Serialise with a fixed style
Indentation width, key order and quoting are applied deterministically, so formatting the same input twice gives identical bytes.
- 3
Show the error position
When parsing fails, the message includes the position so the fix is obvious instead of guessed.
Processing pipeline
Formatting is not validation
A formatter proves the document is syntactically parseable. It does not prove it is valid against a schema, and it does not check business rules. JSON with a duplicated key parses fine and silently keeps the last value.
What gets normalised
Comments are preserved in CSS and SQL but not in JSON, which has no comment syntax. YAML anchors may be expanded, and quote style may change. Keep the original when exact byte layout matters, such as signed payloads.
Verify it yourself
Formatting is deterministic and local — run it twice and compare.
- 1.Open DevTools on this page and switch to the Network tab
- 2.Keep the filter on Fetch/XHR and run the tool
- 3.Confirm no request carries your file — you should see only page assets and fonts
Frequently asked questions
Which directions are supported?
Both TOML→JSON and JSON→TOML. JSON→TOML requires a top-level object.
Typical use cases?
Inspecting Cargo.toml / pyproject.toml, verifying CI configs, or learning TOML syntax.
What this kind of conversion cannot keep
Formatters parse the input into a tree and print it back with consistent indentation. If the input is invalid, you get the parser's error position instead of a silently mangled file — malformed JSON stays malformed rather than being «repaired» into something that is no longer yours.
More in Format
On this page
- What is TOML Converter
- What this tool actually does with your file
- How it actually behaves
- How to use it
- How it works inside
- Frequently asked questions
Excel formula reference
29 functions with syntax, arguments and a table you can retype.
Browse the list →