TOML Formatter & Converter

Format TOML and convert it to and from JSON instantly in your browser. Your data stays on your device.

Your TOML or JSON is parsed and converted locally in your browser and never uploaded, but avoid pasting real secrets or credentials from a config file into any tool.

Working with YAML configs too? Try the YAML ↔ JSON converter.

About TOML Formatter & Converter

This TOML formatter cleans up and validates TOML configuration as you type, and converts it both ways with JSON. Paste a Cargo.toml, pyproject.toml, or any config file to re-serialize it into clean, canonical TOML, or switch modes to turn TOML into pretty JSON and JSON back into TOML. Under the hood it uses a spec-compliant parser, so tables, arrays of tables, inline tables, dates, integers, floats, and booleans all round-trip correctly. When something is off, you get a clear inline error with the line and column instead of a silent failure, which makes it handy as a quick TOML validator. It is built for developers wiring up Rust, Python, or Go configs who want a fast toml to json check without a CLI. Everything runs entirely in your browser, so the config you paste is processed locally and never leaves your device.

Features

How to use the TOML Formatter & Converter

  1. Pick a mode: Format TOML, TOML → JSON, or JSON → TOML.
  2. Paste your TOML or JSON into the input box on the left.
  3. Read the formatted or converted output in the panel on the right.
  4. If the input is invalid, check the inline error for the line and column to fix.
  5. Click Copy to grab the result, or download it as a .toml or .json file.

Example

Input

[database]
enabled = true
ports = [ 8000, 8001, 8002 ]

[[servers]]
name = "alpha"
ip = "10.0.0.1"

Output

{
  "database": {
    "enabled": true,
    "ports": [
      8000,
      8001,
      8002
    ]
  },
  "servers": [
    {
      "name": "alpha",
      "ip": "10.0.0.1"
    }
  ]
}

TOML → JSON expands tables and arrays of tables into nested objects and arrays.

Common errors & troubleshooting

Frequently asked questions

Can it convert TOML to JSON and back?
Yes. Use the TOML → JSON mode to turn a TOML document into pretty JSON, and JSON → TOML to convert a JSON object into TOML. Tables, arrays of tables, and scalar types round-trip in both directions.
Does the formatter validate my TOML?
It does, as a side effect. Formatting parses the document with a spec-compliant parser first, so any syntax problem surfaces as an inline error with the line and column, making it a quick TOML validator.
Which TOML version is supported?
The parser targets TOML 1.0.0, so it understands inline tables, arrays of tables, dotted keys, multi-line strings, RFC 3339 dates and times, integers, floats, and booleans.
Why does JSON → TOML reject an array at the top level?
A TOML document is defined as a table (a set of key/value pairs), so the root must be a JSON object. Wrap a top-level array or primitive in an object before converting it to TOML.
Are comments and key order preserved when I format TOML?
No. Formatting re-serializes the parsed data, so inline comments are dropped and keys are emitted in canonical order with tables after scalars. Keep your original file if the comments matter.
Is my TOML uploaded anywhere when I use this tool?
No. All parsing, formatting, and conversion run entirely in your browser, so your configuration is processed locally on your device and never sent to a server.

Related tools

All ArrayKit tools