Convert data models, not just punctuation

Convert YAML documents to strict JSON locally

The worker uses yaml version 2.9.0 with YAML 1.2 Core Schema by default and optional YAML 1.1 compatibility. Conversion has explicit boundaries because JSON cannot represent every YAML key, tag, comment, reference, or scalar value.

Loading the private YAML to JSON converter…

Enable JavaScript to convert locally. The type, alias, multi-document, and information-loss rules below remain readable.

A bounded conversion workflow

How to convert YAML to JSON online

Choose the same YAML schema as the source consumer, then inspect every change that follows from JSON's smaller data model.

  1. 1

    Paste one YAML stream

    Input may contain one document or several documents separated by ---. The page rejects input above 200,000 UTF-16 code units before starting the local worker.

  2. 2

    Select YAML 1.2 or 1.1

    YAML 1.2 Core is the default. Use YAML 1.1 only for compatibility with a known older loader; the selection can change whether a plain scalar becomes a string, boolean, number, or null.

  3. 3

    Convert and review the JSON

    Inspect types, removed comments, expanded aliases, multi-document wrapping, and key restrictions. Then test the JSON with the receiving application instead of assuming equivalent behavior.

No claim of lossless YAML conversion

YAML to JSON conversion rules

JSON supports objects with string member names, arrays, strings, finite numbers, booleans, and null. YAML can express mappings with non-string or structured keys, node tags, anchors and aliases, presentation comments, multiple documents, and schema-dependent scalar types. Conversion therefore needs a policy rather than a simple character replacement.

One YAML document becomes one JSON value. A stream containing multiple documents becomes one top-level JSON array in source order. Comments disappear because RFC 8259 JSON has no comment node. Anchors do not have a JSON representation, and alias construction is bounded by a maximum alias count of 50 per YAML document.

Alias mapping keys and complex collection keys are rejected. Under YAML 1.1, an unquoted << is a legacy merge-tag key and stops conversion because LiveParse does not expand it. A quoted "<<" key in YAML 1.1 or a literal << key under YAML 1.2 Core remains an ordinary property. !!omap, !!pairs, !!binary, !!set, custom or unresolved tags, non-finite values, and other values without a supported strict JSON representation also stop conversion.

One document
Produces one top-level JSON value.
Several documents
Produce one top-level array in document order.
Aliases
Expand as values with a maximum alias count of 50 per YAML document.
Comments and anchors
Are not represented in the JSON output.

Types deserve an explicit review

YAML values that need care in JSON

Schema-sensitive text

Plain yes, no, on, and off normally stay strings under YAML 1.2 Core but can become booleans in YAML 1.1 compatibility mode.

Numbers and timestamps

Exact arbitrary-size integers are emitted as JSON number tokens. Conversion stops before a finite decimal would round, underflow, or overflow. YAML 1.1 timestamps become ISO 8601 strings, but non-zero sub-millisecond digits stop conversion rather than being truncated. Later JSON consumers may still lose numeric precision.

Mapping keys

JSON object names are strings. A YAML mapping with a sequence, mapping, or another complex node as a key is rejected rather than flattened into an unstable spelling.

References and identity

Two YAML aliases can refer to the same anchored node. JSON duplicates the resulting values and cannot preserve shared node identity, even below the expansion limit.

Before replacing a configuration format

Review checklist for YAML converted to JSON

ReviewWhy it mattersEvidence
Selected schemaYAML 1.2 and 1.1 can resolve plain scalars differently.Compare output types with the original loader.
Document countA multi-document stream becomes an array, changing the top-level shape.Confirm the receiver expects one value or an array.
Comments and tagsComments are removed, while custom or unresolved tags stop conversion.Preserve operational notes elsewhere and resolve tag semantics explicitly.
AliasesExpanded values no longer share identity; the maximum alias count is 50 per YAML document.Inspect repeated output and test mutation assumptions.

Conversion remains in this browser

Private YAML to JSON conversion

The source is processed in a browser worker and is not sent to a conversion API. The 200,000-code-unit input boundary and alias-expansion limit keep the interactive operation bounded. LiveParse stops before its runtime would change a finite decimal or discard non-zero sub-millisecond timestamp digits; equivalent numeric spelling may still normalize, and a downstream JSON parser may still lose precision. These boundaries do not make a configuration safe to deploy.

Configuration can contain secrets even when conversion is local. Clipboard tools, downloads, browser extensions, screen sharing, backups, and device monitoring can handle copied data separately. Use a synthetic sample where possible and remove production credentials before pasting.

Inspect before converting

The YAML tree viewer keeps aliases as references instead of expanding them, which can make anchors, types, and document boundaries easier to audit first.

Open the YAML Viewer →
Check YAML syntax →

Conversion boundaries

YAML to JSON FAQ

How are multiple YAML documents converted to JSON?

A stream with more than one YAML document becomes one top-level JSON array, with one converted value per document in source order.

What happens to YAML comments, anchors, and aliases?

Comments are removed because JSON has no comment model. Anchors are not represented in JSON; aliases are expanded into values with a maximum alias count of 50 per YAML document.

Which YAML values stop conversion?

Alias or complex mapping keys, unsupported tags, YAML 1.1 merge-tag keys, non-finite values, and precision-losing numbers or timestamps stop conversion instead of being silently coerced.

Does the converter upload my YAML?

No. Parsing and conversion run in a local Web Worker. The page does not send the source to a converter service or place it in the URL.