tomlkit.org
TOML utilities, in the browser
Say hi →

JSON to TOML Converter

Paste a JSON object on the left, get TOML on the right. Runs entirely in your browser — nothing is uploaded.

JSON to TOML Converter

updated 25 April 2026

Drop a .json file here, or

Before you start

You need a valid JSON object. TOML is designed to represent configurations, which map to key-value structures. This means your JSON must start with an object (curly braces {}). If you try to convert a top-level JSON array, it'll fail because TOML has no equivalent for a file that is just a naked list.

Also, keep an eye out for null. TOML 1.0 doesn't have a null type. If your JSON has null values, you'll need to remove them or change them to empty strings or a "none" value before converting, otherwise the parser will throw an error.

Everything stays on your machine. I'm using a JavaScript parser to do the heavy lifting right in your browser, so your data never hits my server. This makes it safe for converting sensitive API keys or local config files.

How to use it

  1. Paste your JSON into the left pane, or drag and drop a .json file directly into the editor.
  2. Click Run to trigger the conversion.
  3. If there's a syntax error in your JSON, the status bar at the bottom will tell you exactly where it went wrong.
  4. The TOML output will appear on the right. Deeply nested JSON objects are automatically converted to dotted headers like [owner.profile] for better readability.
  5. Click Copy result to put the TOML on your clipboard.

Example

Input:

{
  "project": "TOML Kit",
  "meta": {
    "version": 1.2,
    "tags": ["web", "tools"]
  }
}

Output:

project = "TOML Kit"

[meta]
version = 1.2
tags = ["web", "tools"]

The nested meta object is converted into a standard TOML table header → [meta].

Tips & common pitfalls

Troubleshooting

I get a "JSON.parse" error when clicking Run.

Your input isn't valid JSON. Check for trailing commas (which JSON hates), missing quotes around keys, or unclosed brackets. The status bar usually gives a hint about the character position where the parser failed.

The output is empty or says "Root must be an object".

TOML files must start with key-value pairs. If your JSON is just a string, a number, or a top-level array (e.g., [1, 2, 3]), it can't be converted to a standalone TOML file. Wrap your data in an object first.

My nested data looks weirdly flat.

That is intentional. TOML is optimized for human readability. Instead of deeply indented inline tables, I use dotted headers which make it much easier to find specific settings in a large file.

Related tools

See also: if you need to do something adjacent on this site, try TOML to JSON to convert TOML to JSON, TOML to YAML to convert TOML to YAML, or YAML to TOML to convert YAML to TOML.

Frequently asked questions

Why does it fail on null values?

TOML 1.0 simply doesn't support null. The spec authors decided that if a value is missing, the key shouldn't be there at all. I chose to error out rather than silently delete your data so you can decide how to handle the missing value.

How are nested objects handled?

I prefer "dotted" table headers ([a.b.c]) over inline tables ({ a = { b = ... } }). Dotted headers are much easier for humans to read and edit in a configuration file, which is the primary use case for TOML.

Does this support the TOML 1.0.0 spec?

Yes. The output follows the TOML 1.0.0 specification, including support for all basic types. It handles complex nesting and arrays of tables correctly according to the official rules.

Does my JSON get uploaded anywhere?

No. Everything happens in your browser's memory using JavaScript. If you look at the network tab in your browser's developer tools, you'll see zero traffic to my server after the initial page load.

Can I convert the result back to JSON to verify it?

Absolutely. You can copy the output and paste it into the TOML to JSON converter. For any JSON-safe input, the round trip should be lossless.