início/dev/yaml-json

YAML to JSON Converter Online

Convert between YAML and JSON

Como usar YAML para JSON

  1. 1

    Paste your data

    Enter YAML or JSON in the input panel.

  2. 2

    Choose direction

    Select YAML to JSON or JSON to YAML.

  3. 3

    Copy result

    The converted output is shown instantly — click copy to use it.

Perguntas frequentes

Is my data safe?
Yes. All processing happens entirely in your browser. Your data never leaves your device and is never uploaded to any server.
Does it support multi-document YAML?
The converter handles single-document YAML files. For multi-document files separated by --- delimiters, convert each document individually by splitting them manually.
Are YAML comments preserved when converting to JSON?
No. JSON does not have a comment syntax, so YAML comments are discarded during conversion. Keep your YAML as the source of truth if comments are important.
What YAML version is supported?
The js-yaml parser supports YAML 1.2, which is the current specification. It is also backward-compatible with YAML 1.1 for most common constructs.
Why does a YAML 'yes' value convert to 'true' in JSON?
In YAML 1.1, unquoted values like yes, no, on, off are interpreted as booleans. If you intend the literal string 'yes', quote it in YAML: 'yes' or "yes". YAML 1.2 removed this behavior, but many parsers still apply it for compatibility.

Saiba mais

O que é YAML to JSON?

Convert YAML to JSON or JSON to YAML instantly with syntax validation and error highlighting. Essential for working with infrastructure configuration files, Kubernetes manifests, Docker Compose files, GitHub Actions workflows, and CI/CD pipeline definitions. YAML is easier to write and read; JSON is required for APIs and tools that do not support YAML. Switch between them in seconds — all processing happens in your browser with no server uploads required.

Por que usar YAML to JSON?

  • Instant bidirectional conversion — convert YAML to JSON or JSON to YAML with one click.
  • Syntax validation — invalid YAML or JSON is caught with a clear error message showing the problem location.
  • Essential for cloud-native workflows — Kubernetes, Helm, Docker Compose, and GitHub Actions all use YAML.
  • Preserves all data types — strings, numbers, booleans, arrays, and nested objects are accurately translated between formats.
  • Completely private — your configuration files and infrastructure code never leave your browser.

Casos de uso de YAML to JSON

Kubernetes manifest authoring

Convert JSON patches or API examples to YAML for use in Kubernetes deployment files, or convert YAML manifests to JSON for programmatic manipulation.

CI/CD pipeline debugging

Convert GitHub Actions, GitLab CI, or CircleCI YAML configs to JSON to inspect their structure programmatically or validate with JSON Schema.

Helm chart development

Convert JSON values files to YAML for Helm charts, or convert Helm output to JSON for debugging rendered templates.

API configuration

Many APIs (AWS, Terraform) accept both YAML and JSON. Convert between them as needed when copying examples from documentation that uses a different format than your project.

Dicas e boas práticas

  • 💡YAML is a superset of JSON — valid JSON is always valid YAML. You can convert JSON to YAML safely, but YAML features like comments and anchors do not have JSON equivalents.
  • 💡YAML indentation matters — use spaces, never tabs. YAML parsers will reject files that mix tabs and spaces.
  • 💡YAML comments (# comment) are lost when converting to JSON because JSON has no comment syntax. If you need comments, keep the YAML as the source of truth.
  • 💡YAML has a gotcha with unquoted special values: yes, no, true, false, on, off, null are parsed as booleans or null rather than strings. Quote them if you mean the literal text.

Como funciona

YAML parsing uses the js-yaml library, which implements the YAML 1.2 specification and correctly handles all data types including multi-line strings, anchors, aliases, and complex mapping keys. JSON-to-YAML conversion uses js-yaml's dump() function with 2-space indentation. YAML-to-JSON uses yaml.load() followed by JSON.stringify() with 2-space indentation. The js-yaml library runs entirely in the browser bundle — no network request is made during conversion. Multi-document YAML (files with --- separators) is parsed as the first document.