Skip to main content
Free File Converter

JSON to YAML converter

Rewrite a JSON file as YAML, which is easier to read and comment.

Processed in your browser. This file is converted on your device and is never uploaded.

Converter

Input

.json up to 25 MB. You can also drag a file here.

Options

No file selected.

About this tool

YAML expresses the same data as JSON with less punctuation and, crucially, with comments. Configuration for CI pipelines, Kubernetes, and most modern tooling is written in YAML, so a JSON payload often has to be translated before it can be checked in.

This tool parses your JSON and writes the equivalent YAML document, with the indentation width you choose.

Supported formats and limits

Input
.json
Output
.yaml (application/yaml)
Output name
The original name with the new extension, for example data.json becomes data.yaml.
File size limit
25 MB
Processing
In your browser. The file is not uploaded.

How to use it

  1. Choose a .json file, or switch to Paste text and paste the JSON directly.
  2. Pick an indentation width of 2 or 4 spaces.
  3. Select Convert, then download the .yaml file.

Limitations

  • JSON has no comments, so none can appear in the output. Converting the other way and back will not restore comments you added by hand.
  • Long strings are wrapped or quoted according to YAML rules, so the output is not a line-for-line mirror of the input.
  • Keys are emitted in their original order. YAML mappings are unordered, so a tool reading the result is not obliged to preserve it.
  • Very deeply nested documents produce heavily indented YAML that is harder to read than the JSON was.
  • The output follows YAML 1.2, where yes, no, on, and off are ordinary strings and so are written unquoted. A tool that still reads YAML 1.1 would take those values for booleans, so quote them by hand if the consumer is an older parser.

Frequently asked questions

Is my file uploaded?
No. The conversion runs entirely in your browser. The file never leaves your device and no request carrying its contents is made.
Is the conversion lossless?
Yes for the data itself. Every JSON value has an exact YAML equivalent, so converting to YAML and back with the YAML to JSON tool gives you the same document. Only formatting and comments are not carried across.
Why are some of my strings quoted?
A bare true, null, or 1.0 would be read back as a boolean, a null, or a number, so strings with those values are quoted to keep them strings. Values such as yes and no are left unquoted, because YAML 1.2 already treats them as strings.
Which YAML version does it produce?
YAML 1.2, which is the version JSON is a strict subset of.