TOML ↔ JSON Converter
Supports common TOML: tables, key-value pairs, strings, numbers, booleans and arrays. Advanced features like inline tables of tables or dates are limited.
How to use this TOML/JSON converter
- Choose the direction: "TOML → JSON" or "JSON → TOML".
- Paste your source data into the left box.
- The converted result appears on the right instantly.
What is TOML used for?
TOML (Tom's Obvious Minimal Language) is a configuration file format designed to be easy for humans to read and write, used by tools like Cargo (Rust), Poetry (Python), and many static site generators.
How do TOML tables work?
A line like [database] starts a "table" (equivalent to a nested object), and every key-value pair below it belongs to that table until the next [section] header.
Why choose TOML over YAML for config files?
TOML has a stricter, less ambiguous syntax than YAML (no significant whitespace beyond simple key alignment), which some developers prefer for configuration files where clarity matters more than brevity.
TOML's core design goal — mapping unambiguously onto a hash table
TOML's own official specification explicitly states its central goal: to map unambiguously to a hash table (a key-value data structure), and to be parseable into that structure by existing tools and libraries across many different programming languages with minimal specialized effort. This isn't just a vague, aspirational design philosophy — it directly explains several of TOML's genuinely distinctive concrete design choices, like requiring every value to have one single, statically clear type determinable directly from its own syntax alone (a quoted value is always a string, a bare true/false is always a boolean), with none of YAML's genuinely more ambiguous type-inference rules described in more detail on this site's own YAML converter tool. This deliberate emphasis on structural clarity and predictability over YAML's more flexible but occasionally ambiguous syntax is exactly why TOML has become particularly popular specifically for configuration files where a wrong, silently misinterpreted type could cause a genuinely serious, hard-to-diagnose problem.
TOML's native datetime type — a genuinely distinctive feature among config formats
Unlike JSON and even YAML, TOML includes native, first-class support for representing dates and timestamps directly as their own proper, distinct data type, following the RFC 3339 standard format, rather than requiring dates to be represented awkwardly as plain strings that some separate piece of application code then has to parse manually afterward. Writing 2024-01-15T14:30:00Z directly in a TOML file is automatically and correctly recognized and parsed as an actual proper datetime value, not merely as a plain text string that merely happens to look like one. This is a genuinely distinctive TOML feature most other common config formats simply lack outright, and it's exactly why this tool's own disclaimer above specifically flags date handling as one of its more limited areas — representing this specific native TOML type correctly and consistently within JSON (which itself has no native date type of its own at all) requires a deliberate, explicit convention decision, precisely the same fundamental kind of structural-mismatch challenge covered in more depth on this site's XML-to-JSON converter tool.
TOML's real origin story — built for GitHub's own API
TOML was created by Tom Preston-Werner, a co-founder of GitHub (its name is literally an acronym for "Tom's Obvious, Minimal Language"), originally developed specifically because he wanted a configuration format combining INI files' straightforward simplicity with genuinely more expressive, structured nesting capability, without taking on YAML's specific ambiguity pitfalls described in detail on this site's own YAML converter tool. Its adoption accelerated considerably once Cargo, the Rust programming language's own official package manager, chose TOML as the format for its central Cargo.toml project configuration file — a decision that exposed a very large number of programmers to TOML for the very first time and helped drive its subsequent, considerable adoption elsewhere, including Python's own Poetry package manager and numerous static site generators, exactly as this tool's own article above mentions.
Array of tables — TOML's most genuinely distinctive and initially confusing syntax
Beyond the FAQ's brief explanation of a basic single [table] above, TOML has a related but genuinely more advanced construct specifically for representing an actual array of table objects: double brackets, [[table]]. Each separate [[products]] header, for instance, starts a brand new, distinct entry appended into an array called "products," with all the key-value pairs immediately following that specific header belonging just to that one particular array entry, until either the next [[products]] header starts a new one or a different section header appears entirely. This double-bracket syntax specifically is genuinely one of the more initially confusing parts of TOML for newcomers first learning the format, precisely because it's TOML's fairly unique, distinctive way of representing something JSON would simply express as a plain, ordinary array of objects using conventional bracket syntax instead.
Limitations of this tool
As the disclaimer above notes, this tool supports common, everyday TOML — tables, key-value pairs, strings, numbers, booleans, and arrays — entirely within your browser, with limited support specifically for inline tables of tables and TOML's native datetime type described above. For configuration files relying heavily on these more advanced, less commonly used TOML features, a dedicated TOML parsing library with full specification support is the more reliable, thorough choice — this tool is deliberately scoped and optimized for the common subset of TOML most everyday configuration files actually use in practice.