← Back to home

JSON ↔ YAML Converter Online

Convert JSON to YAML and back. Realtime, inline errors. Uses js-yaml, YAML 1.2 spec. Useful for Kubernetes / CI/CD / docker-compose configs.

JSON→YAMLYAML→JSONYAML 1.2
name: DevTools
version: '1.0'
features:
  - JSON
  - YAML
  - TOML

Why use this tool

🔄
Bidirectional

Toggle direction with one click — convert JSON to YAML or back without switching tools.

📏
Clean indent

YAML output uses 2-space indent, lineWidth 120. JSON output uses 2-space indent, can be minified.

🎯
Error highlight

YAML parse errors show line + reason. Quick fix.

How to use

  1. 1Pick direction: JSON→YAML or YAML→JSON.
  2. 2Paste source on the left.
  3. 3Output appears in realtime on the right. Copy if you're happy.

JSON ↔ YAML

YAML (YAML Ain't Markup Language) is a superset of JSON with human-friendlier syntax (indent vs {}, # comments, multiline strings). Widely used in Kubernetes, docker-compose, GitHub Actions.

The tool uses js-yaml (YAML 1.2 spec compliant). JSON.parse for parsing JSON. JSON → YAML → JSON round-trip preserves data integrity.

  • YAML 1.2 spec compliant (js-yaml)
  • Bidirectional convert
  • 2-space indent default
  • Multiline strings preserved
  • Error reporting with line
  • Realtime convert
  • 100% client-side

FAQ

TOML support?

Phase 1 is JSON ↔ YAML only. TOML (cargo, pyproject) is coming in Phase 2.

Does YAML support anchors (&, *)?

Yes. js-yaml expands anchors during parse — JSON output duplicates the value.

Are YAML comments preserved when converting to JSON?

No. JSON has no comments. YAML comments are stripped.