YAML to JSON Converter

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

Your text is converted in your browser.

One YAML 1.2 document: nested mappings, lists, multiline strings and ordinary aliases. Mapping keys must be strings.

UTF-8 only, up to 5 MiB per input. You can also drop one file onto the input editor.

Use valid JSON: objects, arrays or scalar values. Strings such as "001" and "true" remain strings in YAML.

UTF-8 only, up to 5 MiB per input. You can also drop one file onto the input editor.

Convert YAML to JSON and JSON to YAML in your browser. Import a UTF-8 file, then copy or download the result.

How to use it

  1. Paste text or select/drop one UTF-8 file, up to 5 MiB.
  2. Choose the direction; enable Minify for compact JSON output.
  3. Convert automatically or press Convert, then copy or download the valid result.

How YAML and JSON conversion works

Convert YAML to JSON and JSON to YAML in your browser. Import a UTF-8 file, then copy or download the result.

A worked example

The nested list becomes a JSON array, active stays a boolean, and quoted code "001" stays text. The multiline note contains a line break.

YAML

name: ToolKan
active: true
code: "001"
tools:
  - YAML
  - JSON
note: |-
  Hello
  world

JSON

{
  "name": "ToolKan",
  "active": true,
  "code": "001",
  "tools": [
    "YAML",
    "JSON"
  ],
  "note": "Hello\nworld"
}

Types, strings and numbers

Objects, arrays, strings, booleans and null are preserved. YAML 1.2 core rules apply: yes/no, on/off and dates are text, while unquoted 001 is a number. Quote values when you mean text. Numbers use JavaScript floating-point precision: decimals may be rounded; unsafe integers and nonfinite values are rejected.

What conversion does not preserve

Comments, blank lines, quoting style and anchor names are not retained. Ordinary aliases expand to independent values; cycles and excessive expansion are rejected. One document only, string keys only, no custom tags or merge keys. Limits: 5 MiB input/output, 100 nesting levels and 100,000 expanded values.

YAML 1.2.2

Frequently asked questions

Does the conversion keep my data types?

Objects, arrays, strings, booleans and null are preserved. YAML 1.2 core rules apply: yes/no, on/off and dates are text, while unquoted 001 is a number. Quote values when you mean text. Numbers use JavaScript floating-point precision: decimals may be rounded; unsafe integers and nonfinite values are rejected.

Can I convert JSON back to YAML?

Convert YAML to JSON and JSON to YAML in your browser. Import a UTF-8 file, then copy or download the result.

Is my configuration file sent to a server?

Your text is converted in your browser.

What conversion does not preserve

Comments, blank lines, quoting style and anchor names are not retained. Ordinary aliases expand to independent values; cycles and excessive expansion are rejected. One document only, string keys only, no custom tags or merge keys. Limits: 5 MiB input/output, 100 nesting levels and 100,000 expanded values.

Recommended Tools