JSONGenerator
GeneratorSchemaConvertersExamplesDocs

JSONGenerator

Free online tools for generating random JSON data and JSON Schemas.

Quick Links

  • JSON Generator
  • JSON Schema Converter
  • Examples
  • Docs
  • Blog
  • About
  • Contact
  • Privacy Policy

Converters

  • JSON to YAML
  • YAML to JSON
  • XML to JSON
  • JSON to XML
  • JSON to TOML
  • TOML to JSON
  • JSON to CSV
  • CSV to JSON
  • JSON to Excel
  • Excel to JSON
  • JSON to HTML table
  • JSON to TypeScript
  • JSON to C#
  • JSON to Go
  • JSON to Java
  • JSON to SQL

Support

Having issues? Contact us.

© 2026 JSON Generator. All rights reserved.

JSON to YAML Converter

Paste JSON and get clean, readable YAML as you type.

Swap directionSwap direction

JSON Input

Paste JSON, upload a .json file or drop one here.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{
  "service": "orders-api",
  "replicas": 3,
  "enabled": true,
  "region": "NO",
  "image": {
    "repository": "ghcr.io/acme/orders",
    "tag": "1.10"
  },
  "ports": [80, 443],
  "env": [
    { "name": "LOG_LEVEL", "value": "info" },
    { "name": "FEATURE_FLAGS", "value": "on" }
  ],
  "description": "Handles order intake\nand fulfilment events."
}

YAML Output

Updates as you type. Copy it or download a .yaml file.

1

Converting…

Convert JSON to YAML online

This free JSON to YAML converter turns any JSON document into clean, block-style YAML. Paste an API response, a package.json-style config or a Kubernetes manifest written in JSON, and the YAML version appears instantly, with your key order, nesting and data types preserved. There is nothing to install and no sign-up, and because the conversion runs in your browser, your data is never uploaded.

YAML is easier to read and edit by hand than JSON: no braces, no trailing-comma errors, and room for comments. That is why tools such as Kubernetes, Docker Compose, GitHub Actions, Ansible and OpenAPI use it for configuration. Converting JSON to YAML is the quickest way to move data you already have into one of those files.

How to convert JSON to YAML

  1. Paste your JSON into the JSON Input editor, or click the upload button to open a .json file. You can also drag a file onto the editor.
  2. The YAML Output updates as you type. If the JSON is invalid, the status bar shows the parser's error so you can fix it.
  3. Optionally choose 2 or 4 space indentation, or sort keys A–Z.
  4. Click Copy to put the YAML on your clipboard, or Download to save it as data.yaml.

JSON to YAML example

Objects become indented key: value pairs and arrays become lists of - items. Notice that the country code NO is quoted in the output; the next section explains why.

JSON input
{
  "name": "web",
  "replicas": 2,
  "debug": false,
  "ports": [80, 443],
  "labels": {
    "tier": "frontend",
    "country": "NO"
  }
}
YAML output
name: web
replicas: 2
debug: false
ports:
  - 80
  - 443
labels:
  tier: frontend
  country: "NO"

How JSON types map to YAML

JSON types and their YAML equivalents
JSONYAML outputNotes
{ } objectIndented key: value pairsAn empty object is written {}.
[ ] arrayLines starting with -An empty array is written [].
stringPlain text, quoted only when neededMulti-line strings use a | block so line breaks are kept.
numberUnchangedLarge numbers keep exponent form, such as 1e+21.
true / falsetrue / falseAlways lower case.
nullnullWritten out explicitly, never left blank.

Ambiguous strings are quoted (the “Norway problem”)

YAML 1.1, still used by PyYAML, go-yaml and therefore Kubernetes and Helm, reads unquoted yes, no, on, off and NO as booleans, and values such as 2024-01-01 as dates. A country list containing Norway (NO) famously turned into false. This converter quotes any string that could be misread like that, along with numeric-looking strings such as version "1.10", so the YAML means exactly what your JSON meant in every parser.

Why convert JSON to YAML?

  • Kubernetes and Helm: Turn a JSON manifest from kubectl get -o json into YAML you can commit and edit.
  • Docker Compose and CI pipelines: GitHub Actions, GitLab CI and Compose files are YAML; convert generated JSON config to match.
  • OpenAPI and Swagger: Specs are usually maintained in YAML because it is easier to review in pull requests.
  • Readable config files: YAML supports comments and needs fewer quotes and brackets, which makes hand editing less error-prone.

Still deciding between the two formats? Read our comparison of YAML vs JSON. If you need sample data to try the converter with, create some with the JSON Generator, and to go the other way, use the YAML to JSON converter.

Frequently Asked Questions

How do I convert JSON to YAML?

Paste your JSON into the JSON Input editor, or upload a .json file. The YAML appears in the output editor as you type. Copy it, or click Download to save it as data.yaml.

Is YAML a superset of JSON?

Yes. Since YAML 1.2, any valid JSON document is also valid YAML, so a YAML parser can read JSON directly. Converting to YAML's block style is still worth it for files that people edit, because it drops the braces, brackets and most quotes.

Why are some strings quoted in the YAML output?

Older YAML 1.1 parsers, which include PyYAML and the Go library behind Kubernetes, read unquoted values such as yes, no, on, off, NO and 2024-01-01 as booleans or dates. The converter quotes those strings, plus numeric-looking strings such as "1.10", so they stay strings in every parser.

Does the converter keep the order of my keys?

Yes. Keys are written in the same order as in your JSON. Tick Sort keys A–Z if you want them sorted alphabetically instead, which makes diffs between config files easier to read.

Can I convert YAML back to JSON?

Yes. Use the YAML to JSON converter, or click Swap direction above the editors. Converting JSON to YAML and back gives you the same data.

Is my JSON uploaded to a server?

No. The conversion runs entirely in your browser with JavaScript, so your data never leaves your device. That makes it safe to use with config files that contain internal hostnames or other private values.

Related converters

  • YAML to JSON ConverterConvert YAML, including anchors and multi-document files, to formatted JSON.
  • XML to JSON ConverterConvert XML to JSON with attributes, repeated elements and text nodes mapped predictably.
  • JSON to XML ConverterConvert JSON to well-formed XML with a root element of your choice.
  • JSON to TOML ConverterConvert JSON to TOML for Cargo, pyproject and other config files.
  • TOML to JSON ConverterConvert TOML tables, arrays of tables and dates to JSON.
  • JSON to CSV ConverterConvert a JSON array to CSV, with nested objects flattened into columns.

See all JSON converters