Skip to content
YAML → Clean YAML or JSONDeveloper tools

YAML Formatter and Validator

Check YAML with a full YAML 1.2 parser, see errors by line, catch values older YAML readers misread (yes, no, 0755, 22:22), tidy the indentation, and turn YAML into JSON or JSON into YAML.

About this tool

About YAML Formatter and Validator

YAML Formatter and Validator checks configuration files such as docker-compose.yml, Kubernetes manifests, GitHub Actions workflows and Ansible playbooks before they break a deployment. Paste the YAML, open a .yml or .yaml file, or drop it on the box. It is read with a full YAML 1.2 parser, so a mistake is reported with its line and column and a snippet of the line; click the line number to jump to it. Duplicate keys and tabs used for indentation are reported as errors, because many tools quietly accept them and then use the wrong value. Valid YAML is written back with even indentation of two or four spaces, keys can be sorted A to Z, and files with several documents separated by --- are kept as separate documents. The summary line counts the keys, how deep the data goes, and any anchors and aliases. A second check looks for values that YAML 1.1 readers, still used by PyYAML, Ansible, Ruby and Go yaml.v2, read differently from YAML 1.2. The best known is the Norway problem: country: NO becomes false. The tool also flags yes, no, on, off, y and n, numbers with a leading zero such as 0755 that old readers take as octal, times and ports such as 22:22 that they read as base-60 numbers, and numbers with underscores. For each one it shows the line and the fix, usually putting the value in quotes. Choose JSON as the output to get the same data as JSON, for an API or a JSON schema. JSON is valid YAML, so pasting JSON gives you YAML. Comments are not carried into the formatted copy; the tool says so when your file has them. Copy the result or download it as a .yaml or .json file. Everything runs in your browser.

YAML Formatter and Validator tool

Where YAML mistakes hurt

Check before you deploy

Docker Compose

Ports and environment variables.

Exampleports: "22:22" quoted.

Kubernetes

Manifests with several documents.

ExampleDeployment --- Service.

GitHub Actions

Workflow files before you push.

Exampleon: push read correctly.

Ansible

Playbooks read by PyYAML.

Exampleenabled: yes becomes true.

Country codes

Lists of countries.

ExampleNO stays Norway.

APIs

YAML config as JSON.

ExampleOpenAPI to JSON.

YAML tips

Avoid the classic traps

Quote words that look like values

Write "yes", "no", "on" and "off" in quotes when you mean the word.

Quote codes with zeros

Postcodes, file modes and IDs such as 0755 keep their zeros only in quotes.

Never use tabs

YAML allows only spaces for indentation.

Quote times

Write "22:22" so no reader turns it into a number.

Check JSON too

Format and validate JSON.

Open JSON Formatter

YAML to JSON

Convert with options.

Open YAML to JSON
Built & tested by

HemantInsights

Senior Software Engineer · Developer of Toolyconvert

Hemant developed YAML Formatter and Validator and tests it on desktop and mobile with real files. He is a senior software engineer from Dehradun, India, building websites since 2014, and designed and developed Toolyconvert end to end.

Last updated 29 November 2026

Answers and guidanceFrequently Asked Questions
How do I validate a YAML file?
Paste it or open the file. Valid YAML shows a green summary; a mistake shows its line and column, and the line number jumps to it.
What is the Norway problem?
Older YAML 1.1 readers turn NO, yes, on and similar words into true or false, so a country code NO becomes false. The tool lists these values; put them in quotes.
Does it find duplicate keys?
Yes. A key written twice in the same map is reported as an error with its line.
Can it convert YAML to JSON?
Yes. Choose JSON as the output. Pasting JSON gives you YAML.
Are comments kept?
Not in the formatted copy. Your original file is unchanged; copy only the parts you need.
Does it support several documents in one file?
Yes. Documents separated by --- are checked and written back separately.
Is my file uploaded?
No. It is read in your browser.
More tools for your workflowRelated Tools

YAML to JSON Converter

Convert YAML to JSON and JSON to YAML as you type. Anchors, merge keys and several documents work, and errors show the line.

JSON Formatter

Format, validate and minify JSON: 2 spaces, 4 spaces or tabs, sort keys, see the exact line and column of errors, fix trailing commas and quotes, copy or download.

TOML Converter

Check TOML with a full TOML 1.0 parser and convert TOML to JSON, JSON to TOML, TOML to YAML and YAML to TOML. Numbers, dates, inline tables and arrays of tables come out right.

XML Formatter and Validator

Check that XML is well-formed, see the error line, format or minify it, convert it to JSON, and search it with XPath. Text, CDATA, comments and namespaces are kept.

1 / 3
Browse all developer tools

Featured on

Toolyconvert is listed on these product directories and launch platforms.