Skip to content
XUtilHub

YAML to JSON Converter Online

Convert YAML to JSON instantly, including multi-document YAML files. Choose pretty-printed or minified JSON output.

  • Free, no sign-up
  • Runs in your browser, nothing uploaded
YAML
JSON

About the YAML to JSON

Convert YAML configuration or data into JSON. Multi-document files (separated by ---) become a JSON array.

Key features

  • Converts YAML to JSON instantly
  • Multi-document YAML becomes a JSON array
  • Pretty-printed or minified output
  • Anchors and aliases are resolved
  • Clear error messages with line numbers
  • Private: runs in your browser

Convert YAML to JSON

YAML is easy to write by hand, but many APIs, tools and programming languages expect JSON. Paste YAML here to convert it instantly.

Example

service:
  name: api
  ports: [80, 443]
  debug: false

becomes

{
  "service": {
    "name": "api",
    "ports": [80, 443],
    "debug": false
  }
}

YAML vs JSON

YAMLJSON
CommentsYes (#)No
Quotes around stringsUsually optionalRequired
StructureIndentationBraces and brackets
Typical useConfig filesAPIs and data exchange

JSON to YAML, YAML validator, and JSON formatter.

How to use the YAML to JSON

  1. Paste your code into the input box, upload a file, or click Sample to try it out.
  2. Choose the options you want, such as indentation, line width or dialect.
  3. The result appears instantly in the output panel. Syntax errors are shown with their line and column.
  4. Click Copy to copy the result, or Download to save it as a file.

Frequently asked questions

What happens to YAML comments?

JSON doesn't support comments, so they're dropped in the conversion.

How are anchors (&) and aliases (*) handled?

Aliases are replaced with the data they refer to, so the JSON contains the full, expanded values.

What about multiple documents separated by ---?

A file with several documents becomes a JSON array with one item per document. A single document becomes a single JSON value.

How are dates converted?

Values are kept as YAML 1.2 defines them: timestamps like 2026-10-23 stay strings unless they're explicitly tagged.

Is my code uploaded anywhere?

No. Every developer tool runs entirely in your browser, so source code, configuration files and passwords never leave your device.

Which formatter do you use?

HTML, CSS and JavaScript are formatted with Prettier, the most widely used code formatter, so the output matches what most projects use. SQL uses sql-formatter, and minification uses Terser and CSSO.

Is there a size limit?

There's no fixed limit. Very large files (several megabytes) can take a few seconds, depending on your device.

Last updated:

Related Dev tools