Online YAML Editor
FV-48Edit YAML and see it checked as you type. The JSON view on the right shows the data your YAML stands for, so a misplaced indent shows up as a wrong shape straight away.
Runs in your browser. Nothing is uploaded.
YAML
Your draft is saved in this browser only. Clear removes it.
View
How to use it
- Paste YAML, open a .yaml or .yml file, or press Sample to see an example.
- Read the status line. If there is an error, press Go to error to select it.
- Check the JSON or Tree view on the right to confirm the structure is what you meant.
- Press Format to fix indentation, then copy, save or download the YAML or the JSON.
How the YAML is read
The text is read with the js-yaml library using the YAML 1.2 core schema, plus merge keys written as <<. Under YAML 1.2, words such as yes, no, on and off stay text, not true and false. Integers too large for JavaScript keep every digit in the JSON view. Errors come with a line and column. Only one document is read, so a file that holds several documents separated by --- is reported.
What Format changes
Format uses Prettier to set even indentation and spacing. Comments, anchors, aliases and key order are kept. Choose 2 or 4 spaces for the indent. Prettier keeps your choice of quotes and block styles in most places, so the result is tidier, not rewritten. The text in the editor is replaced, and undo brings back the original.
Error messages and what to do
| Message | What it means | Fix |
|---|---|---|
JSON has no value for .inf or .nan. Put the value in quotes to keep it as text. | The YAML holds infinity or not-a-number, which YAML allows and JSON cannot represent. | Quote the value, as in ".inf", if you mean the text, or change it to a real number. |
The YAML is empty: it has only comments or a document marker. | There is no data to check, only comment lines or a --- marker. | Add at least one key and value, or one list item, below the comments. |
Questions people ask
How do I find an indentation error in YAML?
Read the status line, which gives the line and column where the reader got stuck, and press Go to error. If there is no error but the data looks wrong, check the JSON view: a key that is indented one level too deep shows up nested inside the key above it.
Why does yes stay as text?
This editor follows the YAML 1.2 core schema, where only true and false are booleans. Older YAML 1.1 readers also treat yes, no, on and off as booleans. If your program uses an older reader, write true or false to be safe.
Does Format keep my comments?
Yes. Format uses Prettier, which keeps comments, anchors, aliases and the order of keys while it fixes indentation and spacing. The JSON view cannot hold comments, so they are absent there.
Can it convert YAML to JSON?
Yes. The JSON view on the right is the converted data. Press Copy or Download with that view open to get the JSON. Merge keys are expanded, and large integers keep every digit.
Is my YAML uploaded?
Nothing is uploaded. The editor runs in your browser, and your draft is saved only in this browser's local storage so it is there when you come back. Clear removes it. Share link puts the text in the link itself, so only people you send the link to can see it.
About this tool
The YAML is read with the js-yaml library using the YAML 1.2 core schema plus merge keys (<<), so yes and no stay text, not true and false. Errors show the line and column. The JSON view shows the data the YAML stands for; integers too large for JavaScript keep every digit. Values .inf and .nan have no JSON form and are reported. Format uses Prettier: it keeps comments and anchors and fixes indentation. Only one document is read: a file with several --- documents is reported. Your draft is kept in this browser only.