YAML to JSON Converter

Convert YAML to JSON as you type.

Paste YAML or upload a file. Nothing is sent to a server.

The JSON appears here as you type.

What Is a YAML to JSON Converter?

A YAML to JSON converter turns YAML, the format used by Kubernetes manifests, Docker Compose files and CI pipelines, into JSON that APIs, scripts and other tools can read. Both formats describe the same kinds of data, so the structure stays the same and only the syntax changes.

This converter runs in your browser, your YAML is not uploaded to Geekflare servers.

How to Use It

  1. Paste YAML on the left, or upload a .yaml or .yml file.
  2. The JSON appears on the right as you type.
  3. Choose the JSON indentation, or pick Minified for a single line.
  4. Copy the JSON or download it as a .json file.

If the YAML has a syntax error, the output lists each error with its line. Select a line to jump to it.

How YAML Maps to JSON

YAMLJSONNotes
name: web{"name": "web"}A mapping becomes an object
- web["web"]A sequence becomes an array
port: 8080{"port": 8080}Unquoted numbers stay numbers
port: "8080"{"port": "8080"}Quoted values stay strings
timeout: null or timeout: ~{"timeout": null}Both forms of null become null
# commentRemovedJSON has no comments
*defaultsA copy of the anchored valueAliases are expanded in place
<<: *defaultsThe anchored keys, merged inKeys set next to the merge win over merged ones
.inf or .nannullJSON has no Infinity or NaN, so the tool flags these

Values That Can Surprise You

The tool follows YAML 1.2, which most current parsers use, and a few values read differently than in older YAML 1.1 files:

  • yes, no, on and off stay strings. Only true and false are booleans. Add %YAML 1.1 and --- at the top of the file to read them the older way.
  • Dates such as 2026-11-04 stay strings, since JSON has no date type.
  • Integers above 9,007,199,254,740,991 lose precision in JSON numbers, so the tool flags them. Quote them to keep every digit.
  • Custom tags such as !Ref in CloudFormation templates are flagged and dropped, and the tagged value is kept.

Multiple Documents

YAML files can hold several documents separated by ---, as Kubernetes manifests often do. JSON has no equivalent, so the tool puts them in one array, in order. A file with a single document converts to that document without an array.

Common YAML Errors

ErrorUsual causeFix
Tabs are not allowed as indentationA tab was used for indentationIndent with spaces
Implicit keys need to be on a single lineA missing colon, or a value that runs over onto the next lineAdd the colon, or quote the value
All mapping items must start at the same columnKeys at the same level have different indentationLine the keys up
Map keys must be uniqueThe same key appears twice in one mappingRemove or rename one of them
Unresolved alias*name is used without a matching &name before itDefine the anchor before using it

After You Convert

To check that the JSON has the shape you expect, create a schema from it with the JSON Schema Generator, then test other files against that schema with the JSON Schema Validator.

More Utilities & Converters tools
Free to start · No card

Building your own app? Try the Geekflare API.

One API key for scraping, search, screenshots, DNS, PDF, and more.

bash
curl -X POST https://api.geekflare.com/webscraping \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com"}'