SmartQueryTools

Convert YAML to JSON Online

Convert YAML files to JSON format directly in your browser. No upload required — your data never leaves your device.

Or paste YAML or JSON text

No file? Paste YAML to get JSON, or switch direction to turn JSON into YAML.

About converting YAML to JSON

YAML to JSON is the most common YAML conversion. Configuration is written in YAML because people can read and comment it, but many APIs, tools and libraries only accept JSON. Kubernetes and OpenAPI tooling, JSON Schema validators, jq and browser code all work on JSON. This page handles both a pasted snippet and a .yaml file.

The two routes behave differently. Pasting YAML text gives an exact translation. A mapping stays an object, a list stays an array, and nesting is kept. The file converter treats YAML as table data. It always writes an array of records, so a config file whose top level is a mapping comes out wrapped in [ ]. Every record also gets every key, with null filling the gaps. Paste config files, and use the file converter for lists of records.

Some things do not survive either route. Comments are dropped, because JSON has none. Anchors, aliases and merge keys are expanded into full copies. A file with several --- sections gives one array holding the records from every section. Unquoted dates become timestamp strings such as "2026-03-02T00:00:00.000Z". A version number written as 1.10 becomes the number 1.1, so quote values like that in the YAML.

Not sure which format you need? Read the JSON vs YAML comparison.

Worked example

A small orders export with an ID, a customer name, a date, an amount (one missing) and a true/false flag, converted with the default settings.

Input (YAML)

- order_id: 1001
  customer: Acme Ltd
  order_date: '2026-03-02'
  amount: 249.5
  shipped: true
- order_id: 1002
  customer: Brightside Co
  order_date: '2026-03-02'
  amount: 1200
  shipped: false
- order_id: 1003
  customer: Acme Ltd
  order_date: '2026-03-05'
  amount: 89.99
  shipped: true
- order_id: 1004
  customer: Northwind
  order_date: '2026-03-07'
  amount: null
  shipped: false

Output (JSON)

[
  {
    "order_id": 1001,
    "customer": "Acme Ltd",
    "order_date": "2026-03-02",
    "amount": 249.5,
    "shipped": true
  },
  {
    "order_id": 1002,
    "customer": "Brightside Co",
    "order_date": "2026-03-02",
    "amount": 1200,
    "shipped": false
  },
  {
    "order_id": 1003,
    "customer": "Acme Ltd",
    "order_date": "2026-03-05",
    "amount": 89.99,
    "shipped": true
  },
  {
    "order_id": 1004,
    "customer": "Northwind",
    "order_date": "2026-03-07",
    "amount": null,
    "shipped": false
  }
]

What changes when you convert YAML to JSON

  • A YAML sequence of mappings becomes a JSON array of objects, indented with two spaces.
  • Quoted strings like '2026-03-02' become JSON strings. Numbers and booleans stay unquoted.
  • null and ~ become JSON null, as in order 1004's "amount": null.
  • Nested mappings become nested objects, and sequences become arrays.
  • In the file converter, a key missing from one record is added to it with the value null.

Your file is processed locally in your browser and is never uploaded. The free limit is 50 MB per file; larger files work if your device has the memory for them.

Frequently Asked Questions

Should I paste my YAML or upload the file?

Paste it when you want an exact translation, such as a config file, a Kubernetes manifest or an OpenAPI spec. Upload the file when it is a list of records and you want a clean, uniform JSON array where every object has the same keys.

Can I convert multi-document YAML with --- separators?

Yes. The file converter joins every document into one array of records, adding each item of a list document and each mapping document as one record. The paste box returns a JSON array with one entry per document instead.

Why did NO or yes not become false or true?

The parser follows YAML 1.2, where only true and false are booleans. NO, yes, on and off stay strings. Older YAML 1.1 tools such as PyYAML read them as booleans, so the same file can produce different JSON in different tools.

What is JSON format?

JSON (JavaScript Object Notation) is a lightweight, human-readable format that supports nested structures, making it ideal for APIs and document-oriented data.

Related Tools