TOML / JSON Converter

Chuyển đổi giữa TOML và JSON.
TOML
JSON

Bidirectional

TOML to JSON and JSON to TOML.

Table Support

Handles TOML sections and nested objects.

Copy Result

One-click copy to clipboard.

Client-side

All processing in your browser. No data uploaded.

Giới thiệu về TOML / JSON Converter

The TOML to JSON Converter makes it easy to move between TOML (Tom's Obvious Minimal Language) and JSON — two formats commonly used for application configuration. TOML is the native configuration format for Rust projects (Cargo.toml), Hugo static sites, Python's pyproject.toml, and many other modern tools. Its clear, INI-inspired syntax is easy for humans to read and edit. JSON, meanwhile, is the standard format for APIs, Node.js configurations, and data exchange. Converting between them lets you inspect TOML configs as structured JSON, migrate configurations between tools that expect different formats, or programmatically process TOML data in environments that natively support JSON. The converter handles TOML sections (denoted by [section] headers), which map to nested objects in JSON, as well as key-value pairs with string, number, boolean, and array values. Going the other way, JSON to TOML renders nested JSON objects as TOML table sections, with primitive values formatted as proper TOML key-value pairs. All conversion happens locally in your browser — no data is sent to any server, so it is safe to use with private configuration files containing database URLs, API keys, and other sensitive settings.

Làm sao để TOML / JSON Converter?

  1. Select your conversion direction using the toggle: "TOML to JSON" or "JSON to TOML".
  2. Paste your TOML configuration or JSON data into the left input panel.
  3. Click the "Convert" button to run the conversion.
  4. The result appears in the right panel. If there is a parsing error, it is shown in red in the output area.
  5. Click "Copy" to copy the converted output to your clipboard.
  6. Switch the direction toggle to convert the other way — remember to paste the appropriate format into the input panel.

Câu hỏi thường gặp

What TOML features are supported?

The converter supports basic TOML syntax: key-value pairs with string (quoted), integer, float, and boolean values; inline arrays; and section tables defined with [section] headers. Advanced TOML features like array of tables ([[array]]), dotted keys, and multi-line strings are partially supported — for complex files, verify the output.

How are TOML sections mapped to JSON?

A TOML section header like [database] becomes a nested JSON object with the key "database". Keys defined under that section become properties of that object. Nested sections like [database.connection] become doubly nested JSON objects.

How are JSON nested objects mapped back to TOML?

Nested JSON objects are converted to TOML table sections. For example, {"server": {"host": "localhost"}} becomes a [server] section with host = "localhost". Primitive values at the top level are written as plain key-value pairs.

Can I use this to convert Cargo.toml or pyproject.toml files?

Yes for standard sections. Cargo.toml and pyproject.toml use standard TOML syntax that this converter handles well. Very complex files using array-of-tables ([[bin]], [[example]]) may require manual adjustment of the output.

Why does my TOML date value show as a string in JSON?

TOML supports native date and datetime types. This converter does not have a dedicated TOML parser with full type support, so datetime values are treated as strings in the output. Use the output as a starting point and adjust date types as needed.

Is my configuration data safe?

Yes. All conversion logic runs in your browser. Nothing is transmitted to any server, so sensitive configuration values like passwords and API keys remain private.

Công cụ liên quan

JSON FormatterYAML ↔ JSON ConverterCSV ↔ JSON ConverterJSON to TypeScriptJSON Tree Viewer
Free Ebook
Top 10 Free Tools Every Developer Needs

Top 10 Free Tools Every Developer Needs

Boost your productivity instantly. Get our exclusive cheatsheet featuring the most essential web utilities you didn't know you needed, delivered straight to your inbox.

We respect your inbox. Unsubscribe at any time.