Skip to content
FreeRuns in your browser

YAML ↔ JSON Converter

Convert YAML to JSON and JSON to YAML instantly, with validation and clear error messages.

Use the YAML ↔ JSON Converter

Loading tool...

What is the YAML ↔ JSON Converter?

YAML and JSON describe the same data model of objects, arrays, strings, numbers, booleans and null, but with different syntax. JSON is strict and machine-friendly; YAML uses indentation instead of braces, allows comments and is far more pleasant to write by hand, which is why it dominates configuration for Kubernetes, Docker Compose, GitHub Actions and OpenAPI.

Converting between them is common when an API expects JSON but your config is in YAML, or when you want to see exactly how a YAML document is interpreted. Beware that YAML has surprises: unquoted values such as yes, no or on can be read as booleans, and 1.10 becomes the number 1.1. Seeing the JSON output reveals these type decisions.

When to use the YAML ↔ JSON Converter

Convert when a tool wants one format and your files use the other: sending a Kubernetes or OpenAPI document to a JSON-only API, turning a JSON response into a readable YAML configuration, or checking how a CI pipeline file is actually interpreted. It is also a quick syntax check, because a YAML document that does not parse will fail here with a line number before it breaks a deployment. Reviewing the JSON output is the best way to catch values that YAML silently turned into booleans or numbers.

How to use the YAML ↔ JSON Converter

  1. Choose the direction: YAML to JSON or JSON to YAML.
  2. Paste your document into the input panel.
  3. The converted output appears; syntax errors are reported with a line number.
  4. Check that strings, numbers and booleans have the types you expect.
  5. Copy the result into your config, request body or repository.

Examples

YAML:

name: web
replicas: 3
ports:
  - 80
  - 443
env:
  DEBUG: "false"
  VERSION: 1.10

JSON:

{
  "name": "web",
  "replicas": 3,
  "ports": [80, 443],
  "env": { "DEBUG": "false", "VERSION": 1.1 }
}

Notice that VERSION: 1.10 became the number 1.1; quote it as "1.10" to keep it a string.

Common errors and tips

  • Indentation matters: YAML must use spaces, never tabs, and consistent nesting.
  • Quote ambiguous values such as "yes", "no", "1.10" and "0123" to keep them as strings.
  • Comments (#) are not representable in JSON and are lost on conversion.
  • A colon followed by a space starts a mapping; values containing : must be quoted.
  • Multi-document YAML files separated by --- convert to a JSON array of documents.

Privacy: runs entirely in your browser

Configuration files often contain internal hostnames and settings; conversion happens locally and nothing is uploaded. This tool runs entirely in your browser: nothing you enter is uploaded, stored or logged on our servers, and it keeps working even if you go offline after the page has loaded.

Frequently asked questions

Are YAML and JSON equivalent?

JSON is practically a subset of YAML 1.2. Both express objects, arrays and scalars, but YAML adds comments, anchors and multi-line strings that have no JSON counterpart.

Why did my "no" become false?
In YAML 1.1, unquoted yes, no, on and off are booleans. Quote the value, for example "no", to keep it as text.
Are comments preserved when converting?

No. JSON has no comment syntax, so comments are dropped when converting YAML to JSON.

Can YAML use tabs for indentation?

No. Tabs are forbidden for indentation in YAML. Use spaces consistently.

What happens to anchors and aliases?

They are resolved: each alias is replaced by a copy of the anchored value in the JSON output.

Ratings & reviews

–

0 reviews

5 star
0 reviews (0%)
4 star
0 reviews (0%)
3 star
0 reviews (0%)
2 star
0 reviews (0%)
1 star
0 reviews (0%)

No reviews yet — be the first to share your experience.

Write a review

Reviews are moderated before they appear.

Your rating *

Photos or videos (optional)

Drag files here or

JPG, PNG, WebP, GIF up to 5 MB. MP4 or WebM up to 25 MB.

  • Featured

    Beautify, minify and validate JSON instantly, with exact line and column for every syntax error.

    Use tool
  • Featured

    Encode text to Base64 or decode Base64 back to readable UTF-8, including URL-safe Base64.

    Use tool
  • Featured

    Generate random v4 and time-ordered v7 UUIDs in bulk, with one-click copy and format options.

    Use tool
  • Regex Tester

    Developer

    Featured

    Test JavaScript regular expressions live, with highlighted matches, capture groups and flag toggles.

    Use tool
  • JWT Decoder

    Developer

    Featured

    Decode JSON Web Tokens to inspect the header, payload and expiry, all without sending the token anywhere.

    Use tool
  • Featured

    Convert Unix timestamps to readable dates and back, in UTC or your local timezone, in seconds or milliseconds.

    Use tool