Skip to content

JSON to TOML Converter

Convert JSON to TOML as you type, with nested objects as tables and arrays of objects as arrays of tables.

Input · JSON
⇄
Output · TOML
Valid JSONRuns in your browser

Load from a URL

Your browser fetches it directly, so the server must allow cross-origin requests (CORS).

How to convert JSON to TOML

  1. Paste a JSON object or open a file. The TOML appears as you type.
  2. Check the note under the output: it says when values were left out.
  3. Press ⇄ to check the round trip in TOML to JSON.

Invalid JSON shows its line and column; the JSON validator explains the message.

Example: a Hugo site config

{
  "baseURL": "https://example.org/",
  "title": "Field Notes",
  "draft": null,
  "params": { "author": "R. Okafor", "showToc": true, "ratio": 1.0 },
  "menu": {
    "main": [
      { "name": "Posts", "url": "/posts/", "weight": 1 },
      { "name": "About", "url": "/about/", "weight": 2 }
    ]
  }
}
baseURL = "https://example.org/"
title = "Field Notes"

[params]
author = "R. Okafor"
showToc = true
ratio = 1

[[menu.main]]
name = "Posts"
url = "/posts/"
weight = 1

[[menu.main]]
name = "About"
url = "/about/"
weight = 2

The note TOML has no null. 1 null value was left out. refers to draft.

How JSON maps to TOML

  • Plain values come first, then each nested object becomes a table named by its path, such as [params] or [server.http].
  • Arrays of objects become arrays of tables: one [[menu.main]] block per item.
  • Arrays of plain values stay inline: regions = [ "eu-north-1", "eu-west-1" ].
  • Keys with spaces or dots are quoted ("dotted.key" = 2) so they are not read as nested tables.
  • null has no TOML form, so the key is left out and counted in the note.
  • Whole numbers become integers: 1.0 became ratio = 1. Add the .0 back if the reader wants a float.

The top level must be an object

A JSON array or a single value cannot be a TOML document. The tool answers TOML needs an object at the top level. and, for an array, suggests wrapping it: {"items": [...]} gives one [[items]] block per item.

For Kubernetes or Docker Compose files, use JSON to YAML instead.

Questions

Which tools read TOML?

Rust (Cargo.toml), Python packaging (pyproject.toml) and static site generators such as Hugo, among others. It suits hand-edited config: it allows comments and has no indentation rules.

Does it write TOML dates?

No. JSON has no date type, so dates stay quoted strings. If your program expects a TOML date, drop the quotes: launch = 2026-11-05.

Is my JSON uploaded?

No, the conversion runs in this tab.

Related tools

Esc