Start a project

Tool 51 of 100 · Data

YAML, JSON & TOML Converter

Paste YAML, JSON or TOML and get the other two, with the exact line of any syntax error and a warning for anything that won't survive the trip.

YAML, JSON & TOML Converter at a glanceIllustration: 1, YAML, JSON or TOML; 2, processed in your browser; 3, Any of the three.YAML, JSON & TOML Converter1YAML, JSON or TOML</>3Any of the three2In yourbrowser
1 YAML, JSON or TOML 2 processed on your device 3 Any of the three

YAML, JSON & TOML Converter

Input

Output

Converted

01

What it does

Converts between YAML, JSON and TOML with error line numbers, anchor expansion and warnings for values that don't translate.

  • Reads YAML 1.2, JSON and TOML 1.0
  • Error messages with line and column
  • Anchors, aliases and << merge keys expanded
  • Warns about values TOML can't hold, such as null

02

Private by design

Everything happens in your browser. Nothing you type, paste or upload is sent anywhere, and it keeps working offline once the page has loaded.

03

What you get

Converted YAML, JSON and TOML files, with a Copy and a Download button on every result.

  • YAML
  • TOML
  • JSON
  • Config

Why it matters

Config lives in all three formats: Kubernetes and GitHub Actions use YAML, Cargo and Python projects use TOML, and APIs speak JSON. Moving settings between them by hand invites indentation mistakes and silent type changes.

YAML in particular has traps: unquoted 'no' or 'on' may become booleans in older parsers, and anchors make files hard to read. This converter uses a parser written for this site, shows exactly where an error is, expands anchors so you can see the real values, and flags anything TOML can't represent, such as null.

How it works

  1. InputA config file in any of the three
  2. In your browserParsed to one data model, checked for YAML gotchas
  3. OutputThe same data in the other formats

Where it fits in a designer's workflow

  1. Plan
  2. Design
  3. Build
  4. Test
  5. Launch
Moving config between Docker, CI, Cargo, Python and JavaScript.

By the numbers

The sample config written in each formatJSON: 727 bytes; YAML: 502 bytes; TOML: 531 bytesJSON727 bytesYAML502 bytesTOML531 bytes
Converted by this tool's own parser and writers: the same 24 keys, 4 levels deep. YAML and TOML drop JSON's quotes and braces, so they're easier to edit by hand; JSON is what APIs and JavaScript read natively. Source: YAML 1.2.2; TOML 1.0.
Show the numbers as a table
FormatBytes
JSON727
YAML502
TOML531

How to use it

  1. Paste a file in YAML, JSON or TOML, or let the tool detect it.
  2. Fix any error at the line shown.
  3. Read the other two formats side by side.
  4. Download the one you need.

FAQ

Does it keep comments?

No. Comments aren't part of the data in any of the three formats, so they can't be carried across.

What happens to null when writing TOML?

TOML has no null. Those keys are left out and listed in a warning.

Is 'no' a boolean?

Not in YAML 1.2, which this tool follows: only true and false are booleans. Older YAML 1.1 tools read no, yes, on and off as booleans, so quote them if other tools read the file.

Are anchors kept in the YAML output?

They are expanded, so each value is written out in full. That's clearer, though longer.

Work with me

Want a site that gets these right?

I build fast, accessible websites and web apps that pass these checks from day one. Tell me about your project and I'll reply personally with honest next steps.

All developer tools · Back to leej.uk