YAML โ†” JSON Converter

Convert between YAML and JSON formats instantly. Pure client-side.

Convert ยท YAML ยท JSON

Convert YAML to JSON and JSON to YAML in your browser. Handy for Kubernetes manifests, GitHub Actions, Ansible snippets, and API samples when one tool wants YAML and another wants JSON.

YAML โ†’ JSON JSON โ†’ YAML Client-side convert Config workflows No upload

Why both formats exist

JSON is strict, ubiquitous in HTTP APIs, and easy for machines. YAML is indentation-based and friendlier for long configs with comments (in YAML 1.1/1.2 workflows). Many systems accept both; humans often edit YAML then need JSON for an API, or receive JSON and want YAML for a Helm values file.

How to use this converter

  1. Paste YAML or JSON into the source panel.
  2. Run the conversion direction you need.
  3. Copy the result; fix any ambiguities YAML introduced (see below).
  4. Validate downstream (kubectl dry-run, CI config linter, JSON Formatter).

YAML footguns to know

GotchaWhat happensMitigation
Unquoted NO, ONMay become booleans in YAML 1.1Quote strings that look like booleans
Leading zerosMay parse as octal/sexagesimal in some loadersQuote ids like "00123"
IndentationStructure changes with spacesUse consistent 2-space indents
Duplicate keysLoader-defined behaviorAvoid duplicates; prefer JSON for strictness
CommentsLost when converting to JSONKeep comments only in YAML source of truth

Kubernetes tip: Manifests are YAML-first, but the API speaks JSON. Converting can help debug kubectl errors โ€” still apply with server-side validation, not only local conversion.

Example

# YAML
service:
  name: api
  ports:
    - 8080
    - 8443

# JSON
{
  "service": {
    "name": "api",
    "ports": [8080, 8443]
  }
}

FAQ

Are comments preserved in JSON?

No. Standard JSON has no comments. Convert back to YAML only restores structure, not original comments.

Does conversion upload my manifests?

No โ€” it runs in the browser. Privacy Policy.

Multi-document YAML (---)?

Support varies. Split documents if the converter targets a single tree.

Related tools

Sponsored