Skip to main content
CaseSwitch

JSON to YAML Converter

Use the CaseSwitch JSON to YAML Converter to turn a JSON object or array into YAML for manifests, workflows, and human-edited config. Paste valid JSON, review the YAML, and copy it. Conversion runs in this browser — nothing is uploaded.

Written by the CaseSwitch editorial team. We maintain these tools in the browser so drafts, keys, and images stay on your device.

Last reviewed: 23 July 2026

Processed locally in your browser. Nothing is sent to a server.

Paste or type text to convert. Output stays empty until there is input.

Character count: 0 · Word count: 0 · Line count: 0

Examples

Simple object

Input

{"name":"app","port":3000}

Output

name: app
port: 3000

Nested list

Input

{"name":"app","port":3000,"tags":["a","b"]}

Output

name: app
port: 3000
tags:
  - a
  - b

Nested object

Input

{"server":{"host":"localhost","port":8080}}

Output

server:
  host: localhost
  port: 8080

Array root

Input

[{"id":1},{"id":2}]

Output

- id: 1
- id: 2

Boolean and null

Input

{"ok":true,"note":null}

Output

ok: true
note: null

How to use

  1. Paste valid JSON into the input panel.
  2. Review the YAML output and quote any strings that YAML might treat as booleans or numbers.
  3. Copy the result into your manifest or values file.

What this tool is for

YAML is the usual edit format for Kubernetes snippets, GitHub Actions, and many values files. JSON is stricter and common in APIs. This converter parses JSON and emits YAML with conventional indentation so you can draft a document in the syntax your tools prefer — without sending cluster-shaped samples to a third-party site.

How it works

JSON is parsed with JSON.parse. The value is then serialized with a YAML dumper (indent default 2, wide line width). Key order follows the object as parsed. Invalid JSON fails fast. JSON has no comments, so none appear in the output — add YAML comments yourself after conversion.

When to use it

Turning a JSON API example into a values.yaml draft, comparing the same data in two syntaxes, and preparing a workflow fragment from a JSON fixture. Validate Kubernetes kinds and apiVersions separately.

When not to use it

YAML 1.1 vs 1.2 gotchas (the “Norway problem”: NO as boolean) can still bite after conversion. Do not assume bit-identical round-trips for every float. This tool does not validate Kubernetes schemas. Huge arrays can become unreadable as YAML.

How it compares to related tools

YAML Formatter pretty-prints YAML you already have. JSON Formatter stays in JSON. CSV to JSON is for tabular imports, not YAML.

Common mistakes

Pasting JS objects with unquoted keys. Expecting comments to survive from JSON. Shipping converted YAML without quoting strings like NO, on, or off when they must stay strings.

Quote strings that look like booleans

Some YAML parsers still treat NO, yes, on, and off as booleans. After conversion, quote country codes and flag-like strings that must remain text. Prefer a quick read-through of enum-like fields before you apply a manifest.

Comments and Kubernetes shape

JSON cannot carry comments, so the YAML output is comment-free. Add explanations after conversion. Resource kinds, apiVersions, and CRD schemas are not checked here — the converter only changes serialization.

Frequently asked questions

Are comments preserved?+

JSON has no comments, so none appear. Add YAML comments after conversion.

Will this produce Kubernetes-ready YAML?+

It produces YAML for the data you pasted. Resource kinds, apiVersions, and schema checks are still your job.

Can I convert YAML back to JSON here?+

This page is JSON → YAML. Format existing YAML with the YAML Formatter, or convert in your editor if you need the reverse.

Why did my float look different?+

JSON and YAML number formatting can differ slightly after parse and dump. Check critical numeric fields.

Is my config uploaded?+

No. Conversion runs in this browser. Still avoid pasting live cluster secrets into screenshots.

Does key order stay stable?+

Order follows what JSON.parse produced for the object. Do not rely on key order as a security boundary.

Does this tool send my payload to CaseSwitch?+

No. Formatting, encoding, and naming conversions for this page run in your browser after load — your sample stays on the device.

Related tools