Convert JSON to YAML

Turn JSON into clean, readable YAML for configuration files, with key order kept and strings quoted only when needed.

Drop your file here, or browse

Images, documents, spreadsheets, data files and subtitles. Your file stays on your device.

Your file is converted on this device and is never uploaded to a server.

Why teams convert JSON to YAML

YAML is easier to read and edit than JSON: no braces, no trailing comma errors, and room for comments. That is why it became the standard for Kubernetes manifests, Docker Compose files, CI pipelines and many application configs.

This converter produces block-style YAML with two-space indentation. Long strings are kept on one line instead of being folded, and values that YAML would misread, such as strings that look like numbers or booleans, are quoted automatically.

JSON vs YAML at a glance

Main differences between the JSON and YAML formats
FeatureJSONYAML
Full nameJavaScript Object NotationYAML Ain't Markup Language
TypeHierarchical dataHierarchical data
IntroducedEarly 2000s (RFC 4627 in 2006)2001
Created byDouglas Crockford; now ECMA-404 and RFC 8259Clark Evans, Ingy döt Net and Oren Ben-Kiki
StructureNested objects and arraysMaps and lists nested by indentation
CommentsNoYes, with #
Data typesString, number, boolean, null, object, arrayStrings, numbers, booleans, null, dates, lists, maps
Best forAPIs, web apps and app settingsConfig files for Kubernetes, CI pipelines and Docker Compose
SupportEvery programming languageMost languages through libraries
MIME typeapplication/jsonapplication/yaml

How to convert JSON to YAML

  1. Step 1: Choose the JSON file

    Drop a .json file onto the converter.

  2. Step 2: YAML is preselected

    Leave the output as YAML.

  3. Step 3: Convert

    The JSON is parsed and written as YAML with the original key order.

  4. Step 4: Download

    Save the .yaml file and add comments or edits as you like.

Output style

Block style

Maps and lists use indentation instead of braces and brackets.

No folding

Long strings stay on a single line.

Smart quoting

Strings like "true", "1.10", "on" or "NO" are quoted, so even older YAML 1.1 parsers read them as strings.

Order preserved

Keys appear in the same order as in the JSON.

Where JSON to YAML fits

  • Kubernetes manifests. Convert JSON output from kubectl or generators into editable YAML.

  • CI pipelines. Draft GitHub Actions or GitLab CI configs from JSON templates.

  • OpenAPI specs. Maintain API definitions in the more readable YAML form.

  • Human-edited settings. Give non-developers a config file that is easier to read.

Adding comments after converting

One of the main reasons to move to YAML is comments. JSON cannot contain them, so the converted file starts without any. Add # comments above keys to document why a setting exists; YAML parsers ignore them.

Keep indentation consistent when editing: two spaces per level, and never tab characters.

Types are kept exactly

Numbers stay numbers, booleans stay booleans and null becomes null. Strings that could be mistaken for another type are wrapped in quotes, which is what keeps a value like "yes" or "0123" a string when the YAML is read back.

Empty objects and arrays are written in flow style as {} and [], since block style has no way to show emptiness.

  • "port": 8080 becomes port: 8080.
  • "version": "1.10" becomes version: "1.10".
  • "tags": [] becomes tags: [].

Tips for JSON to YAML

  • Validate the YAML with your target tool, since each tool has its own schema.
  • Keep the JSON source if it is generated; regenerate YAML rather than editing both.
  • Use YAML to JSON to confirm the round trip gives the same data.
  • Split very large configs into several files for readability.

JSON to YAML questions

What indentation is used?

Two spaces per level, the most common YAML convention.

Will long strings be wrapped?

No. Line folding is disabled, so each string stays on one line.

Is key order preserved?

Yes, keys appear in the same order as in the JSON.

Why are some strings quoted?

Quotes are added where YAML would otherwise read the value as a number, boolean or null.

Can the output have comments?

JSON has no comments to convert, but you can add them to the YAML afterwards.

Is my JSON uploaded?

No. Everything happens in your browser.

Related conversions