Practical guide
How to convert YAML to JSON and check types
YAML can describe more than JSON, so not every configuration supports direct conversion. This guide helps prepare one document, anticipate scalar types and recognize constructs outside the supported profile.
Prepare one document with string keys
Paste one nonempty YAML 1.2 document and select “Process”. Maps need unique string keys and sequences retain order. The root can also be a scalar. Comments alone or an empty --- document marker are insufficient. The tool neither combines documents nor reads external resources.
Unquoted key 1 is numeric and will be rejected; "1" is a string and can name a JSON member. Do not automatically stringify every key without reviewing the data model. For duplicate names, decide which value is correct rather than relying on overwriting an earlier value.
Anticipate types before converting
In this Core profile, true is boolean, null and ~ denote null, and a missing map value also becomes null. Untagged on, off and dates stay strings. Number 001 normalizes to 1, so always quote string codes. YAML 1.1 rules are not used.
The first example distinguishes numeric and string codes. The second separates an absent map value from an empty string. Output is minified JSON without comments or original quote style. Use the separate formatter if needed; do not recreate formatting by changing values.
| YAML | JSON |
|---|---|
code: 001
text: "001"
active: true
mode: on
date: 2026-10-02 | {"code":1,"text":"001","active":true,"mode":"on","date":"2026-10-02"} |
missing:
empty: ""
none: ~ # komentarz | {"missing":null,"empty":"","none":null} |
Numbers: text precision and base conversion
Decimal tokens are normalized textually without intermediate JavaScript Number rounding. For example, +001 becomes 1 and .5 becomes 0.5. Large value 9007199254740993 stays exact in JSON text. A parser that subsequently reads output may still use a less precise numeric type.
Integers 0x10 and 0o10 become decimal 16 and 8. Under this schema, -0o10 is not resolved as a number and remains a string. Infinity .inf and .nan are rejected because JSON has no such numeric values. Do not automatically substitute zero or null for them.
Why are anchors, aliases and tags rejected?
This converter rejects anchors, aliases, explicit tags and merge <<, including a quoted << key. It does not expand reference graphs or language-specific types. These are product boundaries, not claims that such constructs are always invalid YAML. YAML 1.1 and multiple documents are also outside scope.
Do not fix an alias by merely removing & or *: it refers to data that may need controlled expansion in a trusted environment. A tag can likewise alter a value’s meaning. Prepare a self-contained sample under your data contract and compare it with the source; do not flatten configuration without review.
Check limits and discarded presentation
Input allows up to 20,000 UTF-16 units, 32 container levels and 10,000 nodes including map keys. Output is capped at 500,000 units. A parser error, warning or exceeded cap stops conversion. Reduce to a complete sample rather than expecting partial JSON after unsuccessful processing.
Comments, indentation, block style and original hex/octal notation are not reconstructed in JSON. Strings retain their parsed value rather than exact YAML source spelling. Check output against the destination API, especially nulls, identifiers, large numbers and dates. Successful syntax conversion does not establish business-rule compliance.
Privacy, copying and reset
For conversions and schemas, use short anonymized samples instead of production exports. Input and output are processed in the browser without sending them to analytics or keeping history in localStorage or sessionStorage. Page loading still connects your device to hosting. Extensions and clipboard contents remain outside this protection.
Editing clears the old result; select “Process” again. Copying is a separate action. “Clear” restores the form and initial options but cannot remove earlier copies, saved files or printouts. When reporting an issue, include a short synthetic example, selected options and expected output. Do not include secrets or customer data.
Frequently asked questions
Do on and off become booleans?
Not under this YAML 1.2 Core profile. They remain strings; true and false are booleans.
Why does code 001 become 1?
Unquoted, it is numeric. Enter "001" if the contract requires a string identifier.
Are aliases and multiple documents supported?
No. Prepare one self-contained document without anchors, aliases, merge or explicit tags.
Does clearing remove the clipboard copy?
No. The form is reset; earlier clipboard copies, files or printouts need separate removal.
Sources and scope
Examples are synthetic. Limits and supported options describe this site’s tools, not the full standards. Check output in its destination system. This guide does not establish API-contract compliance, configuration security or business-rule correctness.
Tools covered by this guide
UUID and GUID generator
Generate 1–100 UUIDv4 identifiers using Web Crypto randomness, locally and without a timestamp.
JSON to YAML converter
Convert JSON into readable YAML with quoted strings, no anchors and unchanged number tokens.
YAML to JSON converter
Read a single YAML 1.2 document and produce JSON without alias expansion or lost large numbers.
JSON Schema generator
Create a working JSON Schema 2020-12 from a sample with an explicit additional-object-members policy.