Developer

YAML Formatter and Validator

Validate and format YAML, or convert it to and from JSON, with every error located in your text.

Runs entirely in your browser. Nothing you paste is uploaded.

0 characters · 0 bytes

This runs entirely in your browser. Nothing you paste is sent to us or to anyone else.

How to use it

  1. Paste your text into the box marked "Your YAML"Paste a config file, a CI pipeline, a Kubernetes manifest. Everything happens inside your browser — nothing is uploaded, so there is nothing for us to store, log or lose.
  2. Read the result as it updatesThere is no button to press. The document is parsed and re-emitted as you type, so a mistake shows up on the line you are editing. The output recomputes every time you change the text or one of the options above it.
  3. Read indentation errors as structure errorsYAML has no brackets — indentation IS the structure, so a single misplaced space changes what belongs to what. That is why most YAML bugs are invisible until something reads the file.
  4. Watch the values that are not the type you meantUnquoted yes, no, on and off become booleans, and a version like 1.20 becomes a number that loses its trailing zero. The tool shows the parsed value so you can see it happen rather than discovering it in production.
  5. Use the Indent control to match your projectTwo or four spaces. Tabs are not valid YAML indentation at all, which is worth knowing if you have ever pasted from an editor that inserted one.
  6. Copy or download the resultThe buttons under the output put it on your clipboard or save it as a file, and each one says exactly what it will copy or download. Any note about something the tool changed or deliberately left alone is shown with the result rather than hidden.

About this tool

Validate YAML with errors located by line, reformat it canonically, or convert it to and from JSON — the three things people actually need when a config file misbehaves.

The parser is js-yaml, a small and widely audited library, running under the YAML 1.2 core schema. That schema choice matters: unquoted "no" stays the string "no" rather than becoming false (the famous Norway problem), and date-shaped values stay strings rather than silently becoming timestamps. Nothing is ever instantiated or executed from the document.

Understanding the result

A formatted result means the whole document parsed — every indent, anchor and type resolved. That is the validation; the reformatted text is proof of it.

An error names what stopped the parser and on which line, with the surrounding text quoted. YAML errors are usually one indent level off from where they are reported, so look at the line above too.

Converting to JSON resolves everything YAML-specific: anchors and aliases are expanded, multi-document streams become an array, and empty values become null. Each of these is reported when it happens.

Example

Input

server:
  host: localhost
  ports: [5180, 5181]

Output

{
  "server": {
    "host": "localhost",
    "ports": [5180, 5181]
  }
}

Limitations

  • Comments do not survive reformatting or conversion. Parsing turns YAML into data and comments are not data — the tool warns loudly when it sees them, but it cannot keep them. Keep the original file if the comments matter.
  • Anchors are resolved during parsing; reformatted output repeats shared content with generated anchor names, not your original ones.
  • This validates YAML syntax, not your schema — a Kubernetes manifest with a misspelled field is valid YAML, and this tool will say so.
  • Custom tags (!Ref, !!python/...) are not supported; the safe schema refuses to instantiate arbitrary types by design.

Questions

Is my YAML uploaded anywhere?

No. The whole tool is JavaScript running on your device — there is no request to send. You can confirm it by opening your browser's network tab, or by disconnecting from the internet and using the page anyway.

Why did my comments disappear?

Because reformatting parses the document into data and writes it back, and comments exist only in the text, not in the data. Every parser-based YAML formatter has this property; this one tells you instead of letting you find out later. If you only need validation, the original file is untouched — the output is a separate result.

Is "no" a string or a boolean?

A string, here. This tool uses the YAML 1.2 core schema, where only true and false are booleans. Older 1.1 parsers (and some tools still using them) read no/yes/off/on as booleans — the "Norway problem", named for country codes. If your target system uses a 1.1 parser, quote such values to be safe.

Can it convert a Docker Compose or CI file to JSON?

Yes — any valid YAML converts. Just remember the conversion is one-way lossy for comments and anchor names, so it is a way to read or feed data onward, not a way to maintain the file.

Last updated 2026-08-16.

Related tools