YAML / TOML / JSON Converter

A tool for converting between YAML, TOML, and JSON. When the input has a syntax error, it shows the line, column, and surrounding lines. Use it to convert config files or check CI settings — everything runs in your browser.

Your data — config files and all — is never sent to a server. Everything is converted in your browser, so even configs containing API keys stay safe.

How to use

  1. Use the buttons at the top to choose the source and target formats (JSON, YAML, TOML). The arrow button in the middle swaps them.
  2. Type or paste data on the left, or load a file with "Open file" or by drag and drop. The source format is selected automatically from the file extension.
  3. The converted result appears on the right as you type. If there's a syntax error, the line, column, and surrounding lines are shown.
  4. Save the result with "Copy to clipboard" or "Download". For JSON and YAML you can also choose the indentation width.

About this tool

YAML, TOML, and JSON are all text formats widely used for configuration files and data exchange. Kubernetes and GitHub Actions use YAML, Rust's Cargo and Python's pyproject.toml use TOML, and APIs and package.json use JSON — so you often need to convert between them.

This tool uses yaml (ISC license) to parse and generate YAML, and smol-toml (BSD-3-Clause license) for TOML. When there's a syntax error, it shows where the problem is instead of a result, so you can quickly spot misaligned indentation or missing brackets.

Each format can represent slightly different data. TOML has no null and its top level must be key/value pairs, so such values are either left out or reported as errors. TOML date-time values are output as ISO 8601 strings. All conversion happens in your browser, and your data is never sent to a server.

Frequently asked questions

Are YAML comments preserved after conversion?

No. JSON has no concept of comments, so only the parsed data values are converted. Original comments are not included when converting to TOML or YAML either.

What happens when data with null is converted to TOML?

TOML has no equivalent of null, so entries with null values are left out and a warning is shown.

Can I convert multi-document YAML (separated by ---)?

Only a single document is supported. Input with multiple documents results in an error, so convert each document separately.

Is my data sent to a server?

No. All parsing and conversion is done with JavaScript in your browser.