Skip to content

YAML to JSON converter

Paste YAML. JSON is written beside it. Comments are not kept.

JSON has no comment syntax. Comments in the YAML are discarded and do not appear in the output.

Ctrl+Enter or ⌘+Enter runs this tool immediately.

JSON output
YAML input
JSON output

Waiting for input.

Parsing stays in this browser. Input is not uploaded or saved.

How to use this tool

  1. Paste YAML into the input, or choose Sample to load a service configuration.
  2. Pick readable JSON (two spaces) or compact JSON. The output updates after you pause typing.
  3. Copy or download the JSON. If the status says the document is invalid, the download stays empty.

Supported formats and limitations

  • One YAML document only. A stream separated by --- is rejected.
  • Parsing uses the YAML 1.2 core schema. yes, no, on, and off stay strings. true and false are booleans.
  • Comments and anchors' source text are not kept. Aliases are expanded up to a fixed limit.
  • Merge keys (<<) are not expanded. They remain a normal key named <<.
  • Infinity, NaN, and integers outside the JSON safe range (2^53 − 1) stop the conversion instead of being rewritten as null or rounded.

Examples

Booleans, null, and a list

Quoted strings stay strings. Null and booleans use JSON literals.

enabled: true
region: null
tags:
  - api
  - worker

A folded block is still one string

The block becomes a JSON string. Line breaks follow the YAML block style.

banner: |
  Line one
  Line two

Common errors and solutions

Map keys must be unique
Delete or rename the repeated key. The converter does not choose a winner for you.
Tabs are not allowed as indentation
Replace tab characters used for indentation with spaces. Tabs inside quoted strings are fine.
Non-finite number
Replace .inf or .nan with a finite number or a quoted string before converting.

FAQ

Why did my comments disappear?
JSON cannot represent comments. This converter builds a JSON value, so comments are removed on purpose and the page says so when it finds them.
Why is yes a string instead of true?
ConfigKit parses YAML 1.2 core schema. In that schema, yes and no are strings. Use true and false for booleans.
Does this upload my configuration?
No. The YAML is parsed in your browser. It is not sent to an application server, stored in local storage, or placed in the URL.

Read next

Related tools

  • JSON to YAML converter

    Convert valid JSON into YAML with 2-space or 4-space indentation. Nested objects, arrays, and multiline strings are preserved, and invalid JSON is reported instead of repaired.

  • YAML to TOML converter

    Convert one YAML document to TOML in the browser. Comments are dropped, null is rejected, and multi-document streams are not merged.

  • YAML validator

    Check YAML syntax without converting or rewriting it. Errors include a line and column when the parser provides them, and valid input is left unchanged.