Processed in your browser

JSON / YAML Converter

Parse YAML 1.2 core values without custom tags or merge keys. Duplicate keys, unsafe integers, excessive aliases, deep nesting, and oversized node graphs are rejected.

Processed in your browser
0 / 1,000,000
Converted output

Tool guide

What is JSON / YAML Converter?

JSON and YAML Converter targets common configuration and data exchange using a restricted YAML 1.2 core model. Custom tags, merge keys, duplicate keys, and excessive alias expansion are rejected, with limits on depth and node count. Comments, anchors, and scalar styling that cannot survive conversion are disclosed. Common workflows include the following. Convert between a JSON API example and YAML configuration. Check whether YAML can be represented as ordinary JSON data. Generate basic YAML for documentation or deployment files. The page also documents input boundaries, output behavior, and practical cautions so you can review the result before putting it into an application, configuration, test, or production workflow.

When to use it

  • Convert between a JSON API example and YAML configuration.
  • Check whether YAML can be represented as ordinary JSON data.
  • Generate basic YAML for documentation or deployment files.

How to use it

  1. Paste JSON or safe YAML.
  2. Choose the conversion direction.
  3. Review the lossy-mapping note and copy or swap the result.
  4. Load one of the realistic examples first to verify the selected options and processing direction before replacing it with your own data.
  5. Review the output, status message, and documented limits; copy, download, or continue only after the result matches your expectation.

Runnable examples

The “Example 1” and “Example 2” buttons load the matching inputs. They cover different structures, directions, or boundaries and can be run directly in the workspace.

Example 1

{"project":"JSONLane","release":{"branch":"develop","tools":20},"checks":["typecheck","lint","build"]}

Example 2

project: JSONLane
locales:
  - zh-cn
  - en
release:
  branch: develop
  tools: 20
features:
  darkMode: true
  localOnly: true

Input rules

  • JSON input must follow strict JSON syntax.
  • YAML custom tags, merge keys, and duplicate keys are not allowed.
  • Excessive depth, alias expansion, and unsafe integers are rejected.
  • Text input is counted before processing and is limited to 1,000,000 characters on this page; file modes apply the separate file limit shown in the workspace.
  • YAML comments, anchors, aliases, tags, and scalar styles are not preserved.

Output rules

  • JSON-to-YAML emits basic scalars, objects, and arrays.
  • YAML-to-JSON does not retain comments, anchors, tags, or styling.
  • Structures without a reliable mapping cause an error or explicit warning.
  • Output reflects only the current input, direction, and options; rerun after changing a mode or value instead of treating an earlier result as current.
  • Custom tags, duplicate keys, merge keys, unsafe integers, and excessive alias expansion are rejected.

Limitations and cautions

  • YAML comments, anchors, aliases, tags, and scalar styles are not preserved.
  • Custom tags, duplicate keys, merge keys, unsafe integers, and excessive alias expansion are rejected.
  • Depth is limited to 100 and expanded nodes to 50,000.

How your data is handled

The parser works only in the browser, does not load remote YAML references, and does not retain configuration.

FAQ

Can YAML run constructors or code?

No. Custom tags and arbitrary type constructors are rejected.

Are anchors supported?

Aliases are resolved only within a strict expansion limit; anchors are not preserved in JSON.

Will comments survive?

No. JSON has no comment, tag, anchor, or scalar-style equivalent.

Why do YAML comments disappear?

Comments, anchor presentation, and formatting are not part of the JSON data model, so data conversion cannot preserve them.

Why reject custom tags and merge keys?

They can construct types or hide merged data. Restricted rules keep the result predictable and reduce parser risk.

Will dates automatically become Date objects?

No. The tool avoids implicit type guesses and emits values that can be represented safely in ordinary JSON.

Updated: 2026-07-31