Format and validate YAML or convert between YAML and JSON as you type, keeping comments, anchors and exact numbers, with YAML 1.1 and 1.2 support.
Initializing in your browser…
Format, validate and minify JSON, JSONC or JSON5 as you paste, with exact numbers, precise error locations, a tree view, JSONPath queries and schema checks.
Format, minify or convert XML to JSON as you type, with line-and-column error checks, a tree view and XPath queries that handle namespaces.
Convert images between PNG, JPEG, WebP, GIF and BMP (and AVIF where your browser supports it), one at a time or in a batch, and compare how big each format makes your picture.
A deployment file was edited by several people with four-space indentation and needs to match the team's two-space style without losing its comment, anchor or values.
YAML (4-space indent)
# deploy settings
version: 1.0
defaults: &defaults
retries: 3
region: eu-west-1
production:
<<: *defaults
replicas: 4
countries:
- no
- seFormatted, 2 spaces, YAML 1.2
# deploy settings version: 1.0 defaults: &defaults retries: 3 region: eu-west-1 production: <<: *defaults replicas: 4 countries: - no - se
Only the indentation changed: the comment, the anchor &defaults, the merge key, version: 1.0 (not 1) and the unquoted no all stay as written, and list items are now indented under their key. Converting the same file to JSON shows why the YAML version matters: under 1.2, countries becomes ["no", "se"], while under 1.1 it becomes [false, "se"] and production picks up retries and region from the merged defaults.
Paste YAML to re-indent it cleanly, validate it, or convert it to JSON, and paste JSON to turn it into YAML. Comments, anchors, quoting, multi-line strings and the exact spelling of numbers are kept, and errors point to the line and column.
YAML is the configuration language of Docker Compose, Kubernetes, GitHub Actions, Ansible, OpenAPI and countless app settings files. It is readable, but whitespace matters, so a misplaced space or a tab can break a deployment. This tool formats YAML without rewriting it, checks that it parses, and converts between YAML and JSON in either direction, updating as you type.
Formatting that keeps your file. Many formatters load the YAML into data and write a brand new file from it, which throws away comments, renames anchors, turns 1.0 into 1 and 007 into 7, and fails on files that contain several documents separated by ---. This formatter works on the document itself. It normalises indentation to 2 or 4 spaces and can indent list items under their key or not, but keeps comments, anchor and alias names, block scalars (| and >), each document in a multi-document stream, and every number exactly as written, including identifiers longer than a standard double can hold. Quoting is left as it is unless you ask for plain, single or double quotes, and keys can optionally be sorted.
YAML 1.1 or 1.2. The two versions of YAML read some values differently. Under YAML 1.1, which many older parsers and CI tools still use, an unquoted no, off or y is a boolean and 012 is an octal number; under YAML 1.2 they are the string "no" and the number 12. This is the "Norway problem", named after the country code NO turning into false. Choose the version your software uses, and the conversion to JSON follows its rules. The << merge key, common in Docker Compose files for sharing settings, is part of YAML 1.1; read the file as 1.1 and JSON output expands it, with keys written in the mapping itself taking priority.
Clear errors and safe repairs. When the YAML cannot be read, you get the line and column, the line itself with a caret under the problem and a hint, such as a tab used for indentation or a missing space after a colon. A Repair button fixes the most common mistakes (tabs in indentation, key:value without a space, -item without a space, trailing whitespace) and lists every change with its line number. It never deletes a line or changes the nesting of your file.
Converting to and from JSON. YAML to JSON writes standard JSON and lists anything JSON cannot carry: comments, anchors (aliases are expanded into copies), documents after the first and keys that are not strings. JSON to YAML keeps numbers exactly as written, so 19.90 stays 19.90. Everything runs in your browser, which matters for configuration files that contain hostnames, credentials or internal URLs.
Find the exact line where a GitHub Actions workflow or Kubernetes manifest stops parsing, and fix indentation without losing the comments.
Turn a YAML config into JSON for a JavaScript app or an API request, or turn JSON into YAML for a Helm chart or OpenAPI file.
See whether country codes, yes/no flags or zero-padded numbers will be read as text, booleans or numbers by a YAML 1.1 or 1.2 parser.
Re-indent a Compose file consistently while keeping its anchors and comments, and expand the << merges to see the final settings.
A file indented with four spaces, with defaults: &defaults and production: <<: *defaults, formats to two-space indentation with the comment, the anchor name, version: 1.0 and the list of country codes unchanged.
Converting countries: [no, se] to JSON gives ["no", "se"] under YAML 1.2 but [false, "se"] under YAML 1.1. Quoting the value ("no") makes it a string under both.
Under YAML 1.1, base: &base {retries: 3, region: eu} with prod: {<<: *base, retries: 5} converts to "prod": {"retries": 5, "region": "eu"}, because a key written in the mapping overrides a merged one.
No. Comments stay where they are, along with anchors, aliases, block scalars and every document in the file. You can turn comments off under More options if you want a clean copy without them.
Use the version your software reads. Many tools built on PyYAML or older libraries, and some CI systems, use YAML 1.1. Newer libraries, such as the yaml package for JavaScript, default to 1.2. When in doubt, quote values like "no", "on" or "012" so they mean the same thing under both.
YAML does not allow tab characters in indentation; it requires spaces. Press Repair to replace indentation tabs with spaces. Tabs inside values or after the indentation are allowed and left alone.
It copies the keys of another mapping, usually an anchor such as &defaults, into the current one. It comes from YAML 1.1 and is widely used in Docker Compose and CI files. When you convert to JSON reading the file as YAML 1.1, the merge is expanded; under 1.2 it is treated as an ordinary key and the tool says so.
Yes. Numbers are written back exactly as they appear, so 1.0 stays 1.0, 007 stays 007, and a 20-digit ID is not rounded. When converting to JSON, a note lists any value that a program using standard doubles would read differently.
No. Parsing, formatting and conversion run in your browser, so secrets and internal hostnames in your files stay on your device. The share link stores only the settings.
Your text is processed locally in the browser. Nothing you paste or open is transmitted or logged.