Loading...

YAML to JSON Converter Online — Bidirectional, Free, Client-Side

Convert YAML to JSON and JSON to YAML instantly. Paste a Kubernetes manifest, GitHub Actions workflow, or config file and get clean, indented JSON — or paste a JSON object and get readable YAML with proper indentation. Every conversion runs entirely in your browser using js-yaml, so secrets, deploy configs, and internal service definitions never leave your machine. Use this tool to debug CI pipelines, translate config formats between tools that expect different formats, or quickly inspect a YAML file's structure as JSON.

Features

  • Bidirectional conversion

    YAML → JSON and JSON → YAML in the same tool. Swap input and output with one click.

  • Full YAML 1.1 support

    Powered by js-yaml — handles anchors, multi-line strings, comments, and nested structures.

  • Pretty-printed output

    JSON output is indented with 2 spaces; YAML output uses standard block-style indentation.

  • Inline error messages

    Invalid YAML or JSON shows the exact parser error, including line and column when available.

  • Download or copy

    Copy to clipboard for quick pasting, or download the result as a .json or .yaml file.

How to convert YAML to JSON (or back) online

Two clicks to swap formats — no upload, no signup.

  1. Pick a directionClick YAML → JSON to parse YAML, or JSON → YAML to convert a JSON object to YAML.
  2. Paste your inputDrop the YAML or JSON into the left pane. Conversion runs as you type.
  3. Copy or downloadUse the Copy button for quick reuse, or Download to save as a .json or .yaml file.

Examples

YAML → JSON

Input
name: Alice
age: 30
roles:
  - admin
  - user
Output
{
  "name": "Alice",
  "age": 30,
  "roles": [
    "admin",
    "user"
  ]
}

JSON → YAML

Input
{ "service": "api", "port": 8080, "env": ["staging", "prod"] }
Output
service: api
port: 8080
env:
  - staging
  - prod

Frequently Asked Questions

Does the file leave my browser?
No. YAML ↔ JSON runs entirely in client-side JavaScript using the js-yaml library. Nothing is uploaded; nothing is logged. Open DevTools and the Network tab will be empty while you convert.
What YAML features are supported?
Standard YAML 1.1 syntax: mappings, sequences, scalars, multi-line strings, anchors, and aliases. Comments are ignored during parsing, as in any YAML parser.
Why did my YAML fail to parse?
Common causes are inconsistent indentation (YAML requires spaces, not tabs), unescaped special characters in a plain scalar, or a colon inside an unquoted string value. The error message shows the exact issue reported by the parser.
Does JSON → YAML preserve key order?
Yes. Object keys are emitted in the same order they appear in the parsed JSON.
Can I round-trip a file — YAML to JSON and back to YAML?
Yes, use the Swap button after converting. Note that comments and some formatting choices (like flow vs. block style) are not preserved, since JSON has no concept of either.
Is there a size limit?
There is no fixed limit — performance scales with browser memory. The tool comfortably handles typical config files and manifests up to several megabytes.