Skip to content
Convertitive

JSON to YAML & YAML to JSON Converter

JSON ↔ YAML, in either direction, with structure-preserving output.

JSON and YAML describe the same kinds of structured data — objects, arrays, strings, numbers, booleans, null — using different syntax. The widget below parses the input format and emits the other, preserving nesting, type information, and numeric precision. It is the right tool for shifting Kubernetes manifests, GitHub Actions workflows, OpenAPI specs, or any application config between the two formats. All parsing happens locally; nothing is sent to a server.

name: convertitive version: 0.1.0 private: true ports: - 3000 - 3001 features: ads: false analytics: plausible

How to use

  1. Pick a direction

    JSON → YAML or YAML → JSON. The widget shows clear errors if the input is malformed in either direction.

  2. Paste your document

    The output appears as you type. Indentation is normalized to two spaces; sequences are emitted as block style for readability.

  3. Flip with the output

    Click 'Flip direction with output' to round-trip the document — useful for sanity-checking that nothing was lost.

When to choose which

FormatBest for
JSONAPI payloads, machine-to-machine transport, anywhere strict syntax helps catch bugs early.
YAMLHuman-edited configuration, multi-line strings, files where comments matter.

Frequently asked questions

Is the conversion truly lossless?
For the data model both formats share — strings, numbers, booleans, null, arrays, and objects — yes. YAML-specific features that JSON cannot express (anchors, tags, multi-document streams) are not used. Comments are stripped because JSON has no comment syntax.
Why is my number precision changing?
Both parsers use JavaScript Number (IEEE 754 double), which is exact for integers up to 2^53 and for most decimal values. Very large integers (16+ digits) or very long decimals may round to the nearest representable double. For exact integer arithmetic above 2^53, store the value as a JSON string and parse it as BigInt downstream.
Does YAML output include the leading '---'?
No. The output is a single document with no stream marker. If you need a multi-document YAML stream, prepend '---\n' yourself.
How are very long lines handled?
Long strings are emitted on a single line in both formats — line-wrapping is disabled to avoid silently mangling strings that contain trailing whitespace or line-sensitive content.
What if my YAML has anchors and aliases?
Anchors and aliases (& and *) are parsed and resolved transparently — the JSON output contains the materialized values. The reverse direction does not re-introduce anchors; identical subtrees are duplicated.
Is this safe for secrets?
The tool runs entirely in your browser and never makes a network call. Convertitive cannot see, log, or persist the document you paste. That said, treat browser history, autofill, and clipboard sharing tools as you would with any sensitive paste.

About

Data-model overlap

Both JSON and YAML 1.2 share the core JSON data model: scalars (strings, numbers, booleans, null), sequences (arrays), and mappings (objects). Anything you can express in JSON has a direct YAML equivalent; the reverse is mostly true, with the exception of YAML's non-string mapping keys and stream-level features.

When YAML's flexibility bites

Norway-shaped strings (the unquoted token 'no' or 'off' parsing as boolean false in YAML 1.1), unquoted version strings ('1.0' parsing as a number), and significant indentation are real footguns. The parser here uses YAML 1.2 semantics, which restored 'no' / 'off' as plain strings — but a converter is not a substitute for a good config schema.