YAML input

or drop a file here, or paste code below
YAML input

JSON output

JSON output

Files never leave your browserHow?

Paste YAML or open a .yaml file and get JSON as you type. Syntax errors are shown with line and column, so the converter is also a quick YAML validator.

How it works

  1. Paste or open YAML

    Paste a Kubernetes manifest, Docker Compose file or OpenAPI spec, open a .yaml or .yml file, load one from a URL or try the sample.

  2. Check the result

    The JSON updates on every change. Errors and warnings show the line, and Go to error moves the cursor there.

  3. Download or copy

    Save the .json file, copy it, or open it in the JSON Viewer. The JSON → YAML button converts it back.

Features

  • YAML validation

    Wrong indentation, unclosed brackets and tabs used for indentation are reported with line and column. Duplicate keys are listed as warnings with their line; the last value wins.

  • Anchors, aliases and merge keys

    References like &base, *base and <<: *base are resolved into plain JSON objects. Alias bombs that would expand into gigabytes are stopped.

  • Multiple documents

    A file with several documents separated by --- becomes a JSON array, or you can convert only the first document.

  • YAML 1.2 or 1.1

    The YAML 1.2 core schema keeps yes, no, on and off as text. Choose YAML 1.1 to read them as booleans and dates as timestamps, like older tools do, or the strict JSON schema.

  • Exact numbers, safe tags

    Large integers such as IDs keep all digits. Unknown tags like !!python/object are never executed; their value stays a string.

Limits & privacy

Files can be up to 50 MB, also after decompressing a .gz file. Files above 5 MB are converted from the file without loading them into the editor.

Comments are not part of JSON and are dropped. Custom tags are not constructed, and validation against a JSON Schema (Kubernetes, OpenAPI) is not available yet. See the privacy page.

FAQ

How do I convert YAML to JSON?

Paste the YAML into the editor or open the file. The JSON appears next to it; press Download .JSON or Copy.

Can I use this as a YAML validator?

Yes. Invalid YAML shows an error with line and column instead of JSON, and duplicate keys are reported as warnings.

Why did yes become a string?

In YAML 1.2, which most tools use today, yes and no are plain text. Select YAML 1.1 if your files were written for an older parser that treats them as true and false.

Can I convert an OpenAPI or Swagger YAML file to JSON?

Yes. OpenAPI and Swagger specs are ordinary YAML, so they convert to the equivalent JSON spec. Validation against the OpenAPI schema is not done here.

What happens with several documents in one file?

By default they become an array with one element per document. Choose First document only to get a single object.

Do I need a CLI like yq?

No installation is needed: the conversion runs in your browser on Windows, macOS, Linux and mobile. For scripts and pipelines a CLI is still the better choice.

Is my YAML sent anywhere?

No. Secrets in config files stay on your device; the conversion runs in a Web Worker.

Related tools