YAML to JSON converter
Read a single YAML 1.2 document and produce JSON without alias expansion or lost large numbers.
Enter data
One YAML 1.2 document, up to 20,000 UTF-16 units. Fields marked with an asterisk are required.
About this tool
YAML includes constructs with no direct JSON equivalent, so not every document can be converted. This tool accepts a bounded YAML 1.2 Core profile: maps with string keys, sequences and scalar values. Comments and presentation style disappear. Quote codes with leading zeros to prevent numeric interpretation.
How to use the calculator
- Paste one YAML 1.2 document. Quote string identifiers and check indentation.
- Remove anchors, aliases, explicit tags and merge constructs under your data rules.
- Select “Process”; copy JSON and check it against the destination API.
Calculation details
Formula and calculation method
A YAML 1.2 Core parser builds a tree without expanding aliases. String keys and values are serialized as JSON literals. Decimal number tokens are normalized textually; hexadecimal/octal integers use BigInt without intermediate Number rounding.
Worked example
Separate lines code: "001", active: true and city: Łódź produce {"code":"001","active":true,"city":"Łódź"}. Unquoted 001 becomes number 1. Untagged on and 2026-10-02 remain strings under this profile.
Limitations
- Input up to 20,000 UTF-16 units, 32 container levels, 10,000 nodes including keys and output up to 500,000 units. One document with a value; comments without data are insufficient.
- Anchors, aliases, merge (<<), explicit tags, YAML 1.1, multiple documents, duplicate/non-string keys, .inf, .nan and unpaired Unicode surrogates are rejected. Files and network resources are not read.
- Comments, quote style, indentation and hexadecimal/octal spelling are not reconstructed. Large numbers stay exact in JSON text, but destination parsing may lose precision.
Sources
- YAML 1.2.2 — syntax and Core schema
- yaml library — documents, types and parser options
- IETF RFC 8259 — JSON syntax and interoperability
Engine version: 1.0.0 · Last reviewed: 2 October 2026
Frequently asked questions
Does on mean true?
Not in YAML 1.2 Core. on/off remain strings. YAML 1.1 applications may use different rules.
Why are aliases rejected?
JSON does not carry YAML reference identity. Aliases are not expanded, avoiding cycles and uncontrolled data growth.
Will comments be retained?
No. JSON has no comment syntax. Keep the original YAML if comments matter.
Is content uploaded or saved?
Input and output are not submitted to a server or analytics or saved in form history or the URL. Copying is a separate action. Reset cannot remove earlier copies, printouts or extension data. Do not paste secrets.