{ JSON to TOML }

// translate json objects into toml config syntax

Convert JSON objects to TOML configuration syntax instantly. Free browser-based tool — no upload, no sign-up, fast and accurate.

Paste a valid JSON object or array

TOML output will appear here

Paste JSON and click Convert

HOW TO USE

  1. 01
    Paste JSON

    Drop your JSON object or array into the left panel.

  2. 02
    Choose options

    Select indent size and compact or expanded mode.

  3. 03
    Convert & copy

    Click Convert, then copy or download the TOML output.

FEATURES

Nested objects → [tables] Array of tables → [[]] All TOML value types Multiline strings Download .toml file Quoted keys support

USE CASES

  • 🔧 Migrate app config from JSON to TOML (Rust, Go)
  • 🔧 Generate Cargo.toml or pyproject.toml fields
  • 🔧 Convert package.json subsets to TOML
  • 🔧 Build Hugo or Zola site config files

WHAT IS TOML?

TOML (Tom's Obvious Minimal Language) is a config file format designed to be easy to read. It maps unambiguously to a hash table and is widely used in Rust (Cargo.toml), Python (pyproject.toml), and static site generators like Hugo.

RELATED TOOLS

FREQUENTLY ASKED QUESTIONS

What JSON types are supported?

All standard JSON types: strings, integers, floats, booleans, null (converted to empty string), arrays, and nested objects. Datetime strings in ISO 8601 format are output as bare TOML datetimes.

How are nested objects converted?

Nested JSON objects become TOML [table] headers. Arrays of objects become [[array of tables]] syntax. Plain value arrays map to TOML inline arrays.

Can I convert an array as the root value?

TOML requires a root object (hash table), so a bare JSON array cannot be converted directly. Wrap it in an object first, e.g. {"items": [...]}.

Are special characters in keys handled?

Yes. Keys containing characters outside [A-Za-z0-9_-] are automatically quoted with double-quotes in the TOML output.

Is my JSON data sent to a server?

The conversion is processed server-side via a lightweight PHP endpoint on the same domain. No data is stored or logged. Your input is discarded immediately after the response is sent.

What is the "compact" mode?

Compact mode renders small nested objects as TOML inline tables {key = "val"} on a single line instead of expanding them into full [table] sections. Useful for very small configs.

How are float values output?

Floats always include a decimal point (e.g. 1.0 not 1) to comply with TOML spec. Special values nan, inf, and -inf are output as bare TOML literals.

Can I download the TOML result?

Yes — click the ⬇ .toml button after conversion to download the result as a .toml file directly from your browser.

JSON to TOML Converter — Free Online Tool

Converting configuration files between formats is a routine task for developers working across multiple ecosystems. This free JSON to TOML converter lets you paste any valid JSON object and instantly receive well-structured TOML output — no installation, no account, no file upload required. The conversion runs entirely through a lightweight server-side endpoint and your data is never stored.

💡 Looking for premium web development assets? MonsterONE offers unlimited downloads of templates, UI kits, and developer assets — worth checking out.

What Is TOML and Why Use It?

TOML stands for Tom's Obvious Minimal Language. Created by Tom Preston-Werner (co-founder of GitHub), it was designed to be a configuration file format that is easy to read, easy to write, and maps unambiguously to a hash table. Unlike YAML, TOML has no significant-whitespace rules and no ambiguous parsing edge cases. Unlike JSON, TOML supports comments natively and has cleaner syntax for multi-level configuration.

TOML is the default config format for the Rust ecosystem (Cargo.toml), Python packaging (pyproject.toml), and static site generators like Hugo and Zola. If you're migrating a project from a Node.js or JavaScript toolchain to Rust, Go, or Python, converting your existing JSON config to TOML is a very common first step.

How the Conversion Works

The converter walks your JSON tree recursively and maps each value type to its TOML equivalent:

JSON vs TOML — Key Differences

JSON was designed as a data interchange format — readable by machines first, humans second. TOML was designed as a configuration format — readable by humans first, parsed by machines second. This leads to several practical differences when you compare the two:

Common Use Cases

Rust / Cargo: When starting a Rust project, you frequently need to populate Cargo.toml with dependency metadata that you've already defined in a package.json or another JSON config. This converter lets you draft those fields in JSON and convert in one click.

Hugo Static Sites: Hugo supports TOML, YAML, and JSON front matter. If you have existing JSON front matter blocks or a config.json file, converting to TOML gives you the cleaner Hugo-native format with comment support.

Python pyproject.toml: PEP 518 and PEP 621 introduced pyproject.toml as the standard Python project metadata file. If you're migrating from a setup.json or custom JSON config, this tool handles the structural conversion, leaving you to fill in Python-specific fields.

Go / Viper config: Many Go applications use Viper for configuration management, which supports TOML natively. Converting your existing JSON config to TOML gives you a cleaner, more human-readable starting point.

Tips for Best Results

Before pasting your JSON, make sure it is valid — the converter will report any parse errors with a descriptive message. If your JSON root is an array rather than an object, wrap it in a parent object key ({"items": [...]}) since TOML requires a root hash table. For very large configs with many deeply nested levels, the expanded output mode produces the most readable TOML. Use compact mode for small, flat configs where inline tables read naturally.

Handling Null Values

TOML does not have a null literal. This is a deliberate design decision — Tom Preston-Werner argued that configuration files should not need to express the absence of a value; instead, omit the key entirely. This converter maps JSON null to an empty string "" as a safe fallback. You may want to manually remove those keys from the TOML output if the null semantics are important in your application.