TOML ↔ JSON Converter

Convert between TOML and JSON formats bidirectionally

Convert TOML to JSON or JSON to TOML online in both directions. Paste configuration files such as Cargo.toml, pyproject.toml, or app settings and get accurate, well-formatted output instantly. This free TOML and JSON converter helps developers move configuration between tools and validate TOML syntax.

Input (TOML or JSON)
Output

Converted output will appear here.
Click TOML → JSON or JSON → TOML.

About TOML ↔ JSON Converter

The TOML ↔ JSON Converter provides bidirectional conversion between TOML and JSON formats. TOML (Tom's Obvious Minimal Language) is a popular configuration file format used by Rust's Cargo, Python's pyproject.toml, Hugo, and many other tools. This converter makes it easy to transform TOML configuration files into JSON for API consumption or convert JSON data into clean TOML configuration files.

Key Features

  • Bidirectional conversion — convert TOML to JSON and JSON to TOML in the same tool.
  • Full TOML v1.0 support — handles tables, arrays of tables, inline tables, multiline strings, dates, and all TOML data types.
  • Clean output — produces properly indented, human-readable output in both directions.
  • Client-side processing — all conversion happens in your browser. No data is sent to any server.

How to Use

  1. Paste or upload — enter TOML or JSON content in the input editor, or upload a file.
  2. Choose direction — click TOML → JSON or JSON → TOML.
  3. Export — copy the result or download it as a file.

TOML and JSON: When Each Format Fits

TOML was designed to be easy for people to read and edit, which is why it is used for configuration files such as Cargo.toml, pyproject.toml and Hugo site settings. JSON is stricter and more verbose, but it is understood by every programming language and every web API. Converting between the two lets you keep a friendly configuration file for humans while feeding the same data to tools, scripts and services that only accept JSON.

Real-World Use Cases

  • Reading a pyproject.toml or Cargo.toml file in a script that expects JSON.
  • Posting configuration to a REST endpoint that only accepts JSON bodies.
  • Turning a JSON sample into a readable TOML file for a static site generator or command-line tool.
  • Comparing two configuration files by converting both to the same format before running a diff.
  • Learning TOML syntax by seeing how familiar JSON structures translate.

How the Conversion Maps Data

TOML tables become JSON objects, and arrays of tables written with double brackets become JSON arrays of objects. Inline tables, nested tables and dotted keys all resolve to nested JSON objects. Strings, integers, floating point numbers and booleans map directly. TOML has native date and time types that JSON lacks, so those values are written as ISO 8601 strings. Going from JSON to TOML, objects become tables and arrays of objects become arrays of tables.

Things to Watch For

  • JSON null has no TOML equivalent, so null values may be omitted or need manual handling.
  • TOML requires a table at the top level, so a JSON file whose root is an array cannot be converted directly.
  • Comments in TOML are discarded when converting to JSON because JSON does not support comments.
  • Key order is preserved where possible, but TOML may group simple values before nested tables.

Tips for Best Results

Validate your input first; a single stray quote or missing bracket will stop the conversion and the error message points to the offending line. After converting, review the result in your target tool, because configuration files often rely on implicit defaults that are not visible in the converted data.

Related Conversion Tools

If your configuration needs another format, the JSON to YAML converter handles Kubernetes and CI style files, and the JSON Formatter helps you validate and read the converted result. Converting through JSON is a convenient way to move configuration between ecosystems that each prefer a different file format.

Frequently Asked Questions

What is TOML?

TOML is a configuration file format that is easy to read due to its clear semantics. It is used by Cargo (Rust), pip/Poetry (Python), Hugo, and many modern tools.

Does this handle TOML dates and times?

Yes. TOML datetime values are converted to ISO 8601 strings in JSON, and ISO 8601 strings in JSON are preserved as strings in TOML.