CraftTools

YAML ⇄ JSON Converter

Guide: JSON vs YAML vs XML vs CSV: Choosing a Data Format

Nothing you enter or choose here leaves your device. This tool runs in your browser.

How to use

  1. 1Choose YAML to JSON or JSON to YAML.
  2. 2Paste your data into the input box.
  3. 3Read the converted result and pick the indentation you want.
  4. 4Click Copy output, or use the output as the next input.

Frequently asked questions

Does it keep my data exactly?

Values, lists and nested objects convert faithfully. YAML comments, anchors and formatting aren't kept, because JSON has no way to store them.

What happens with several YAML documents?

A file with documents separated by --- is converted to a JSON list with one item per document.

Is it safe to paste a config with secrets?

Conversion happens in your browser and nothing is uploaded. YAML is read in safe mode, so it can't run code.

Why is my YAML invalid?

The usual causes are tabs used for indentation, inconsistent indentation, or a missing space after a colon. The error shows the line and column to check.

Read the guide

Learn how this works and how to get the most from it.

Developer

JSON vs YAML vs XML vs CSV: Choosing a Data Format

The strengths and weaknesses of JSON, YAML, XML and CSV, with simple advice on which to use for APIs, config files and spreadsheets.

1 min read

JSON Formatter & Validator

Prettify, minify and validate JSON, with error line numbers.

JSON to DTO Generator

Turn JSON into Java, C#, TypeScript, Kotlin, Python or Go classes.

CSV ⇄ JSON Converter

Convert CSV to JSON and JSON to CSV, with any delimiter.

Text Diff Checker

Compare two texts side by side and see exactly what changed.