Shard Tools

YAML to JSON Converter

Convert YAML to JSON or JSON to YAML in your browser.

Maintained by Roshan.

Use YAML to JSON Converter

Converts between YAML and JSON in this tab. The parser is fetched only when you convert, so the page stays light until you use it.

This parser follows YAML 1.2Only true and false are booleans. Older YAML 1.1 parsers also treated yes, no, on and off as booleans, which is why a country code of NO could silently become false. Quote any value whose literal text matters.

Explore developer and data tools

Find related browser-local tools for nearby tasks without starting another search.

Browse all developer and data tools

About YAML to JSON Converter

Convert YAML configuration into JSON for an API payload, validation step or application that expects JSON syntax. YAML comments, anchors and presentation choices do not all have direct equivalents in JSON, so the useful check is the parsed data rather than whether the formatting looks similar. The browser parses the input locally and shows errors before you use the output. Multi-document YAML is represented as a JSON array; check whether your destination expects that array or a single object. The reverse direction remains available for a round-trip check, while the separate JSON-to-YAML page explains authoring a maintainable YAML configuration.

Work through the input

  1. Start in the YAML-to-JSON direction and paste the YAML you intend to convert. Read parser errors before copying the result. If you reverse the conversion, compare the data values rather than expecting comments and formatting to return.
  2. YAML is read with the safe schema, which will not construct arbitrary objects from tags. That restriction matters for a tool that accepts text pasted from anywhere: YAML's full schema can be coaxed into instantiating types, and a converter has no business doing that.
  3. Multi-document files are handled. YAML allows several documents in one file separated by three dashes, which Kubernetes manifests use constantly. JSON has no equivalent, so the documents come back as an array and the result says how many there were.
  4. Going the other way, long strings are never wrapped onto multiple lines and repeated objects are written out in full rather than as anchors. Both choices favour output a person can read and paste, over output that is technically shorter.

When yaml to json converter is useful

A manifest into an API call

A deployment file written as YAML becomes the JSON body an API expects, with a multi-document file arriving as an array rather than failing to parse.

An API response into a config file

JSON returned by a service becomes YAML that is comfortable to edit by hand and to review in a pull request.

Finding why a value is wrong

Converting to JSON shows exactly how the parser understood your file. A version number that arrives as a number rather than a string is immediately visible.

Checking a round trip

Convert one way, switch direction, and convert back. Anything that changed is something the formats disagree about, which is what you want to find before deploying.

Check the output

Questions about YAML to JSON Converter

Why did yes stay a string instead of becoming true?

Because this follows YAML 1.2, where only true and false are booleans. YAML 1.1 coerced yes, no, on and off, which caused real bugs. If you need a boolean, write true or false.

What happens to my comments?

They are lost. JSON cannot represent comments, so they cannot survive the conversion and cannot be restored by converting back. Keep the original if the comments matter.

Can it handle Kubernetes-style multi-document files?

Yes. Documents separated by three dashes are all parsed and returned as a JSON array, with a note stating how many were found.

Why is the YAML output not using anchors?

Repeated objects are written out in full deliberately. Anchors and aliases are compact but hard to read, and most people converting to YAML want something they can review and edit.

Related tools

JSON Formatter and Validator

Format, minify, and validate JSON locally in your browser. Inspect keys, values, nesting depth, and root type without sending private API data to a server.

JSON to CSV Converter

Convert JSON objects to UTF-8 CSV in your browser. Union columns, quote values, and protect formula-like strings.

CSV to JSON Converter

Convert CSV to a JSON array locally. Parse quoted commas, embedded newlines, BOM files, duplicate headers, sparse rows, and optional safe value types.

JSON to YAML

Convert JSON into clean, readable YAML in your browser. Useful for Kubernetes manifests, CI pipelines and application config.

INI to JSON

Turn an INI configuration file into JSON in your browser. Sections become nested objects and values stay strings.

ENV to JSON

Turn a .env file into JSON in your browser. Handles export prefixes, quotes and inline comments.