Format and validate YAML in your browser, convert YAML to JSON, or paste JSON to get YAML. Errors show the line and column of the first problem.
Runs in your browser — your input is processed on this device and never uploaded.
YAML to format and validate, or JSON to turn into YAML. Maximum 8 MiB. Duplicate keys are rejected. Comments and anchors are not preserved.
Results appear here.
YAML is a text format for nested maps, lists, strings and numbers. Config files use it because indentation is easier to type than JSON braces, but one wrong indent breaks the whole file. A YAML formatter parses the document, which validates it, and writes it back with consistent indentation.
This tool formats and validates YAML in your browser and shows the same data as JSON. Paste a document of up to 8 MiB.
Because JSON is valid YAML 1.2, you can also paste JSON here and copy the YAML version.
A Kubernetes manifest with mixed tabs and spaces looks fine until the runtime rejects it. Hand-wrapped YAML hides nesting the same way minified JSON does: you cannot see which key owns a list, and a truncated paste looks valid until something downstream fails.
Format it with a stable indent and you can read the shape, copy a field, or drop the result into a diff. The JSON view is for tools that will not take YAML, and the YAML view is for configs you started as JSON.
Sorting keys is a separate job. Two maps that differ only in key order are equal to most programs and unequal in a text diff. Sorting makes the text match. It is not a cryptographic canonical form.
JSON Formatter and Minifier on ToolkitBay is the better fit when you want JSON back out, and JSON Validator when you only need a yes or no on JSON. yq, Python's PyYAML and the format command in many editors do the same work locally. Use those when the file is already on disk or inside a pipeline.
Do not use the output as a comment-preserving rewrite of a Helm values file or any other file people annotate. Comments are dropped on purpose.
YAML 1.1 treated on, yes and no as booleans, which surprised people who wrote flag: on and got true. YAML 1.2 does not do that, and this tool follows 1.2, so flag: on stays the string on.
The same rule works in reverse. Converting the JSON {"flag": "on"} writes flag: on without quotes, which is correct YAML 1.2. A YAML 1.1 reader such as PyYAML will read it as true, so quote those values by hand if one sits downstream.
The formatter parses into a value tree and writes it back. Anchors are expanded, and original quoting is not kept.
Formatting runs in your browser. The YAML is not sent to ToolkitBay's servers.