Skip to content
epitometool

JSON to YAML

JSON & data

Convert JSON to YAML and back without losing types.

Updated

JSON input

Options

YAML output


name: epitome-tool
version: 1.0.0
servers:
  - host: us-east-1.example.com
        port: 443
  - host: eu-west-1.example.com
        port: 443
options:
  verbose: true
  retries: 3
  description: "Multi-line
yaml output
as a literal block."

Quick start

How to convert JSON to YAML

Paste JSON, tweak indent and quoting, copy the YAML — runs entirely in your browser.

  1. Step 1
    Paste JSON

    Drop your JSON object or array into the textarea.

  2. Step 2
    Pick options

    Choose indent (2, 4, etc.), string quoting style (auto / always-double / always-single) and the multi-line block threshold.

  3. Step 3
    Copy YAML

    Copy the result and drop it into a Kubernetes manifest, GitHub Action workflow, Ansible playbook — wherever you need YAML.

In-depth guide

Convert JSON to YAML in the browser

Paste JSON, pick your indent and string-quoting style, and get clean block-style YAML — ready for Kubernetes manifests, GitHub Actions workflows, Ansible playbooks or any other YAML-driven config. Everything runs locally.

When YAML beats JSON

  • Human-edited config — comments, multi-line strings, less punctuation. YAML wins.
  • CI/CD workflows — GitHub Actions, GitLab, CircleCI all use YAML.
  • Kubernetes — manifests, Helm charts, kustomize.
  • Infrastructure-as-code — Ansible playbooks, CloudFormation (when not using JSON).

For wire-format data exchange, JSON's strictness still wins — fewer parser quirks.

When do I need quotes?

YAML's "no-quote where possible" rule is what makes it readable, but bare scalars get re-interpreted:

StringBareQuoted
yesboolean truestring "yes"
123integerstring "123"
2024-05-17date (YAML 1.1)string
- valuelist itemstring

This tool's 'auto' mode catches all these cases. 'Always quote' is safer for machine-edited config; bare-when-possible is more readable.

Multi-line strings

YAML has two block-scalar styles for long strings:

  • | literal — preserves line breaks exactly. Used for code, log lines, signatures.
  • > folded — joins lines with spaces, double-newlines become single newlines. Used for prose.

This tool emits | literal blocks for strings longer than the threshold that contain newlines.

Frequently asked questions

Does this tool send my JSON anywhere?

No. The conversion runs in your browser with a hand-written YAML emitter — no network requests, no analytics on your data.

Which YAML features are supported?

The JSON subset: scalars (strings, numbers, booleans, nulls), arrays, objects, multi-line strings via the literal | block scalar. Output is always block-style — no flow style, anchors, aliases or tags.

Why is my plain string sometimes quoted?

Strings like 'yes', 'on', '123', or anything starting with a special character (-, :, {, [) would be reinterpreted as booleans, numbers or YAML syntax if left bare. The 'auto' quoting mode adds quotes whenever the bare form would change meaning.

What about Infinity, NaN, undefined?

JSON doesn't allow them. If they survive your input somehow, NaN and Infinity emit as .nan and .inf (YAML 1.2 conventions); undefined becomes null.

Can I round-trip back to JSON?

If the YAML stays in this subset, yes — use any YAML parser (PyYAML, js-yaml, gopkg.in/yaml.v3) and serialise as JSON. Most edge cases (timestamps, special floats) won't appear because we only emit JSON-compatible types.

How does indent affect the output?

YAML doesn't care about indent width as long as it's consistent within a document. 2 is most common in cloud-config; 4 is common in Ansible. Pick whatever your team uses.

Keep exploring

More tools you'll like

Hand-picked utilities that pair well with the one you're on — all free, client-side, and zero-signup.