Skip to content

TOML to JSON converter

Convert a TOML configuration document to JSON, right in your browser.

Input
Output

TOML to JSON converter

Paste a TOML configuration file and get back a clean, structured JSON object — the format most scripts, APIs and build tools actually expect. TOML is the default for Rust's Cargo.toml, Python's pyproject.toml, Hugo and countless app configs precisely because it's easy for humans to read and write, but the moment that config needs to reach JavaScript, a CI step or a REST call, JSON is what the rest of the toolchain wants. This converter closes that gap without installing a parser or writing a script.

The parser covers the parts of TOML 1.0 you'll actually meet in a real config: bare and quoted keys, dotted keys like server.host that build nested objects, basic strings with escapes and their triple-quoted multi-line form, literal strings for paths that shouldn't be escaped, integers in decimal, hex, octal or binary with underscore separators, floats including exponents and inf/nan, booleans, offset and local date-times, arrays spanning multiple lines with trailing commas, inline tables, and both [table] and [[array of tables]] headers for repeated blocks like a list of servers or dependencies. Comments starting with # are dropped, exactly as TOML defines them.

Choose how the JSON is indented — two spaces, four spaces, tabs, or a single minified line for pasting elsewhere — and optionally sort every object's keys alphabetically, which makes diffing two versions of a generated config far easier. If the TOML has a syntax problem, the tool names the exact line and what's wrong — an unclosed string, a missing equals sign, a duplicate key — instead of just failing silently.

Everything runs locally in your browser. Nothing you paste is uploaded anywhere, which matters when the config holds database hosts, API endpoints or other details you'd rather not send to a server just to reformat a file.

FAQ

Which parts of TOML does this support?
The practical 1.0 subset: keys (bare, quoted, dotted), basic and literal strings including multi-line forms, integers in decimal/hex/octal/binary, floats with exponents and inf/nan, booleans, date-times and dates, arrays, inline tables, [table] and [[array of tables]] headers, and # comments.
What happens to dates and date-times?
TOML has real date and time types that JSON doesn't, so they're kept exactly as written — as JSON strings like "1979-05-27T07:32:00Z" — rather than being guessed into something else.
How are [[array of tables]] blocks converted?
Each [[name]] header appends a new object to an array under that key, so repeated blocks — a list of dependencies, servers or fruits — become a JSON array of objects in the order they appear.
What does it do when the TOML has a mistake?
It reports the line number and a short reason — an unclosed string, a missing '=', a key defined twice — instead of returning a blank or partially converted result.
Is my config file uploaded anywhere?
No. The conversion runs entirely in your browser and the TOML you paste never leaves your device — safe for configs holding credentials or internal hostnames.