FormatterHQ

YAML Editor

Edit YAML in a highlighted editor with live error checking, a tree view of the parsed data, one-click formatting and a shareable saved link.

Input YAML
Output JSON
Ready.

How to use the YAML Editor

  1. Paste or type YAML in the input editor, or open a file with Upload file or Load URL.
  2. Keep Auto update on and click View Tree: the tree refreshes and errors appear with line and column as you type.
  3. Click Format to tidy indentation (2 or 4 spaces), or Validate to see the parsed data as JSON.
  4. Copy or download your file, or use Save & Share to keep a link to it.

An online YAML editor with live checking

This YAML editor is meant for the small edits you make outside your usual environment: adjusting a CI workflow on a borrowed machine, fixing a Compose file from a support ticket, or preparing a config snippet for documentation. You type in a syntax-highlighted editor, and the page parses the file after every change, so indentation mistakes show up immediately with their line and column rather than when a pipeline fails.

An editing loop that catches mistakes early

  1. Edit in the input panel. Highlighting separates keys, strings, numbers and comments.
  2. Check the tree. With View Tree selected, the Tree tab shows the parsed structure. If a key you meant to nest under env appears at the top level instead, the indentation is wrong.
  3. Read errors in the status bar. Invalid YAML produces messages such as bad indentation of a mapping entry (line 3, column 2).
  4. Format when you are done, to normalize indentation to 2 or 4 spaces with comments kept.

Example: a nesting mistake the tree reveals

services:
  web:
    image: nginx:1.27
  ports:
    - "8080:80"

This is valid YAML, so there is no error message, but the tree shows ports as a sibling of web rather than a child of it. Indenting ports two more spaces moves it under web, and the tree updates as you type. Mistakes like this are exactly the kind that syntax checking alone cannot catch.

The three actions

  • View Tree – parses the YAML and shows a collapsible tree plus a nested table in Preview and the data as JSON in Code.
  • Format – tidies the YAML itself, keeping comments. Pick the Indent (2 or 4 spaces) first.
  • Validate – confirms the file parses and reports the number of documents for multi-document files.

Keeping your work

There are three ways to keep what you edited: Copy, Download (saves the output panel), and Save & Share, which stores the input and options on our server and gives you a link you can reopen or send to a colleague. Remember that anyone with the link can see the content, so remove secrets such as passwords and tokens first.

Tips for editing YAML by hand

  • Never indent with tabs; YAML rejects them.
  • Quote values that contain : or start with characters like @, *, & or !.
  • Quote version numbers and codes with leading zeros, e.g. "1.10" and "01234", or they become numbers.

For purely read-only exploration, the YAML viewer is simpler, and the JSON editor gives you the same workflow for JSON. To compare your edited file with the original, paste both into the diff checker.

Privacy

Editing, parsing and formatting happen in your browser. Content is sent to our server only when you use Load URL or choose to Save & Share.

Frequently asked questions

Can I edit values directly in the tree?
No, the tree is a read-only view of the parsed data. Make changes in the text editor; the tree refreshes automatically while Auto update is on.
Does the editor keep my comments when formatting?
Yes. Format keeps comments and only adjusts indentation and spacing.
Is my YAML saved automatically?
No. Nothing is stored unless you click Save & Share. Otherwise use Copy or Download before closing the page.
Why is there no error even though my file is wrong?
The file may be valid YAML with a different structure than you intended, such as a key indented at the wrong level. Check the Tree tab to see where each key actually ended up.

Last updated October 3, 2026

Related tools

CSV Editor Online Edit CSV files online like a spreadsheet: change cells, add, move or delete rows and columns, sort, filter, find and replace, undo, then export. Online HTML Editor Write and edit HTML with autocompletion and a sandboxed live preview, then copy or download the finished document. JSON Editor Edit JSON online with a live tree preview, instant validation and one-click formatting, repair and minification. Online Markdown Editor Write Markdown with a live side-by-side preview and the generated HTML source. Free online Markdown editor, no sign-up. Mermaid Live Editor Write Mermaid flowcharts, sequence, class, ER, Gantt and state diagrams with a live preview, then export SVG or PNG. Online Code Editor Multi-language online code editor with syntax highlighting for 30+ languages. Open, edit, save and download code files. YAML Formatter Format YAML online with consistent indentation while keeping comments. Validate syntax and see the exact line of any error. YAML Parser Parse YAML online and see the resulting data as JSON and a tree. Check types, anchors and multi-document files. YAML Pretty Print Pretty print YAML online and see the yq, PyYAML and js-yaml settings that give the same block style, key order and indent. YAML Validator Validate YAML syntax online. Catch bad indentation, duplicate keys and invalid values with exact line and column numbers. YAML Viewer View YAML as an interactive tree and table. Explore nested maps and lists and see how every value is parsed. YAML Beautifier Clean up messy Kubernetes, Compose and CI YAML: consistent indentation and spacing, with comments and anchors kept as written.