Use this free YAML to JSON converter to turn YAML into clean JSON, or to convert JSON back into readable YAML. Paste your data, choose a direction and an indentation size, then click Convert. If the input is invalid, the tool shows the error with its line and column so you can fix it quickly. You can copy the result or download it as a file.
YAML is friendly to read and JSON is friendly to parse. Convert between them whenever a tool expects the other one.
How to use the YAML to JSON converter
- Choose a direction: pick YAML to JSON or JSON to YAML.
- Paste your data: drop in a config file, an API payload, or a CI pipeline snippet.
- Pick an indentation: 2 or 4 spaces for the converted output.
- Click Convert: the result appears with a short summary of keys and depth.
- Copy or download: save the output as a .json or .yaml file.
What the tool does
| Action | Best for | What you get |
|---|---|---|
| YAML to JSON | APIs, scripts, and tools that expect JSON | Formatted JSON with the same data |
| JSON to YAML | Config files, Kubernetes, and CI pipelines | Readable YAML with your chosen indentation |
| Validate | Finding syntax mistakes | A valid or invalid result with line and column |
| Indentation | Matching your project style | 2 or 4 space output |
YAML vs JSON
- Syntax: YAML uses indentation and dashes, while JSON uses braces, brackets, and double quotes.
- Comments: YAML supports
#comments. JSON does not, so comments are lost when you convert to JSON. - Readability: YAML is easier to read and edit by hand. JSON is stricter and easier for programs to parse.
- Data model: both describe the same core types: objects, arrays, strings, numbers, booleans, and null.
Common YAML errors
- Tabs for indentation: YAML only allows spaces for indentation.
- Inconsistent indentation: items at the same level must line up exactly.
- Missing space after a colon: write
key: value, notkey:value. - Duplicate keys: the same key twice in one mapping is an error.
- Unquoted special values: a value like
1.10becomes the number 1.1. Quote it as"1.10"to keep it as text. - Multiple documents: files with several
---sections must be converted one document at a time.
Whether you are moving a Kubernetes manifest or tidying a config file, a quick conversion and validation catches mistakes before they ship.
Worked examples
Convert a YAML config to JSON
Paste name: app followed by an indented ports: list with - 80 and - 443, then click Convert. The tool returns a JSON object with a name string and a ports array.
Convert JSON to YAML
Switch to JSON to YAML and paste {"id":1,"tags":["a","b"]}. Each key goes on its own line and the array becomes a dash list.
Find a syntax error
Paste YAML where one line is indented with a tab. The tool reports the problem and points to the line and column where parsing failed.
Frequently asked questions
Is this YAML to JSON converter free to use?
Yes. You can convert, validate, copy, and download without creating an account.
Is my data uploaded or stored?
No. All processing happens in your browser. Nothing you paste is sent to a server or saved, and clearing the form removes it from the screen.
Does it validate YAML and JSON?
Yes. The input is parsed first, so invalid YAML or JSON shows an error message with a line and column when available.
Are comments kept when I convert YAML to JSON?
No. JSON has no comment syntax, so YAML comments are dropped. Converting back to YAML will not restore them.
Does it support anchors and aliases?
Yes. Anchors (&) and aliases (*) are resolved, so the JSON contains the full repeated values.
Can it convert YAML files with multiple documents?
No. Only one document at a time is supported. Split the file at each --- line and convert the sections separately.