JSON ↔ YAML Converter

Convert JSON to YAML or YAML to formatted JSON. Your input is processed locally in your browser.

Português

Convert a document

Choose the input format and paste one document. Changing direction keeps your input and clears the previous result.

Quotes are kept when needed to preserve a key as text or keep YAML valid. String values remain quoted.

Supported values and conversion limits

Convert objects with string keys, arrays, strings, booleans, null and finite numbers. YAML uses the 1.2 Core schema: dates and words such as yes, no, on and off are strings. Quote values such as "true", "null" or "001" when you want text. Output uses two-space indentation and quotes string values. By default, unnecessary quotes around keys are omitted; disable the option to quote all keys.

JSON cannot preserve YAML comments, whitespace, quoting styles or directives. These are omitted from the result, with a conversion notice. Object key order may change, especially for numeric names. Numeric spelling such as 1.0 or 1e2 is normalized.

Duplicate keys, non-string keys, merge keys, explicit tags (including timestamps, binary data and sets), anchors, aliases and multiple YAML documents are rejected. Expand aliases and merges yourself; convert special types to strings before using this tool. YAML 1.1 directives are rejected to avoid different type rules.

Numbers use JavaScript precision. Unsafe integers, decimals that would change when serialized, overflow, underflow, NaN, infinity and negative zero are rejected. Quote large identifiers or exact decimals to preserve them as strings.

Limits: 1,000,000 input characters, 100 nesting levels and 50,000 nodes, including mapping keys. Larger documents must be split before conversion.

Example

JSON input:

{"name":"Dev4Bits","active":true,"tools":["JSON","YAML"]}

Equivalent YAML input for the reverse direction:

name: Dev4Bits
active: true
tools:
  - JSON
  - YAML

Related tools