How to Change YAML to JSON (and Back)
Developer · Step-by-step guide · 4 steps · 2 min read
YAML and JSON are two ways to write data as text. Settings files often use YAML. Apps often want JSON. This tool swaps between them as you type.
Open the YAML to JSON Converter
In the pictures, orange letters like A show where to look. Each step tells you its letter.
Step 1: Pick the direction
At the top, choose YAML → JSON or JSON → YAML. See A in the picture.
Step 2: Paste your text
Paste your YAML or JSON into the left box. Or press Load Sample to try it. See B in the picture.
Step 3: See the result
The result shows on the right right away. If there is a mistake, the tool tells you which line it is on. See C in the picture.
Step 4: Copy the result
Press Copy Output. Use Result as Input moves the result to the left box. See D in the picture.

Tips and questions
Why does my YAML not work?
YAML is strict about spaces. Use spaces, not tabs. Items at the same level must line up exactly. The error points to the line to fix.
Are comments kept?
No. JSON has no comments. So YAML comments are dropped.
Can it handle big files?
Yes, as much as your browser can hold. Everything runs on your device.
Privacy
Your data is handled in your browser. It is never sent to us. So it is safe to paste private or work data.
Try it now
The YAML to JSON Converter is free. You do not need an account.
Open the YAML to JSON Converter