Free tool

JSON to YAML and TOML

Paste your JSON and get YAML or TOML with modern syntax instantly. Own emitter verified by round-trip against reference parsers.

server:
  host: 0.0.0.0
  port: 8080
database:
  url: postgres://localhost/app
  pool: 10
  ssl: false
features:
  - auth
  - logs

The emitter produces modern-syntax YAML and TOML (block style and tables). In TOML, null values become empty strings because the format has no null.

Built by

Miguel Ángel Colorado Marin (MACM)

Full-Stack Developer · Guadalajara, España

I develop web apps, digital tools and full projects — from design to deployment.

Contact me

The three most-used config formats coexist in any serious project: package.json in JSON, compose files and workflows in YAML, Cargo.toml or pyproject.toml in TOML. Translating between them by hand invites subtle indentation or escaping mistakes that break the parser. This converter ships its own emitter — no external libraries — producing block-style YAML and idiomatic TOML with nested tables and arrays of tables, handling the hard cases: strings that look like numbers or booleans, keys with spaces or hashes, multiline text and empty containers. The implementation is validated through automated round-trip tests: every output is re-parsed with reference parsers (js-yaml and smol-toml) and must rebuild exactly the original JSON.

Features

  • Block-style YAML output with clean indentation
  • TOML with [a.b] tables and [[a.b]] arrays of tables
  • Proper escaping for special strings and odd keys
  • Invalid JSON detection with a clear message
  • 100% local: your data never leaves the browser

How do I convert JSON to YAML or TOML?

  1. 1

    Paste your JSON

    Any valid object; hit the sample button to try it out.

  2. 2

    Pick the target

    Switch between the YAML and TOML tabs.

  3. 3

    Review the output

    The emitter handles indentation, escaping and tables automatically.

  4. 4

    Copy or download

    To clipboard or as a ready-to-use .yaml / .toml file.

Frequently asked questions

What happens with nulls in TOML?

TOML has no null value. This converter represents them as empty strings; if you need to tell them apart, replace them with a sentinel like "null" before converting.

Why are some strings quoted in YAML?

When a string could be misread as another type — a number, true/false, null, a date, or it starts with reserved characters — it gets quoted so parsers read it as text.

Does it support YAML or TOML back to JSON?

This version converts only from JSON into the other two — the direction where the emitter can guarantee full correctness without parsing ambiguities.

Related tools

Embed JSON to YAML/TOML on your site

Add JSON to YAML/TOML to any web page with a simple iframe. Free, with attribution to miguelacm.es.

<iframe
  src="https://miguelacm.es/embed/json-yaml-toml-converter"
  width="100%"
  height="700"
  frameborder="0"
  title="JSON to YAML/TOML — miguelacm.es"
></iframe>
View embed in new tab →