BROWSER TOOL

JSON and YAML converter Free

Convert JSON to YAML or YAML back to JSON in your browser, with line-numbered errors for invalid input and a choice of indentation.

Processed on your device · your files are never uploaded
Direction
204 characters
Ready

About JSON and YAML converter

Paste JSON to get clean, block-style YAML, or paste YAML to get formatted JSON. It is handy for configuration files such as Docker Compose, GitHub Actions, Kubernetes manifests and OpenAPI documents, where one tool expects YAML and another produces JSON.

The YAML reader is written for HandyTechHelper and covers the parts of YAML that configuration files use day to day: nested mappings and lists, quoted and plain values, numbers, booleans, null, comments, multi-line | and > blocks, and inline [ ] and { } collections. When something is not supported or not valid, it tells you which line to look at instead of guessing.

How to use it

  1. Choose the direction: JSON to YAML, or YAML to JSON.
  2. Paste your text or open a .json, .yaml or .yml file.
  3. Pick the indentation, then copy the result or download it as a file.

Good to know

  • Anchors and aliases (& and *), tags (!), directives, complex ? keys and files with several --- documents are not supported and are reported as errors.
  • YAML comments cannot be carried into JSON, and key order follows the source. Values follow the YAML 1.2 rules, so yes, no, on and off stay text.
  • Whole numbers larger than about 9 quadrillion lose precision, as they do in JavaScript. .inf and .nan have no JSON equivalent and are reported.
  • Input is limited to 1,000,000 characters.

Questions and answers

Why are some of my values in quotes in the YAML?

Text that YAML would read as something else, such as true, null, 123, yes or a value starting with a special character, is quoted so it stays text when read back.

Does it keep my comments?

Comments are allowed in YAML input but JSON has no comments, so they are dropped when converting to JSON.

Is my data uploaded?

No. The conversion runs in your browser, and the text never leaves your device.

Keep going