JSON

YAML ↔ JSON Converter

Convert YAML to JSON and JSON to YAML safely in your browser.

YAML input0 characters
JSON output0 characters
Ctrl+Enter to convert
Enter YAML to convert.

Your data stays private

This tool runs directly in your browser. The content you enter is processed locally and is not sent to TechFixGen servers. No account or signup is required.

YAML ↔ JSON conversion, explained

What is YAML?

YAML is a human-friendly data format that uses indentation instead of braces and commas. It is common in configuration files, CI pipelines, infrastructure definitions, and developers' tooling. Its structure maps directly onto JSON's objects, arrays, strings, numbers, booleans, and nulls.

This converter works in both directions: YAML to JSON for feeding configuration into tools, and JSON to YAML when you need a configuration file for a project that expects YAML.

Converting YAML to JSON

A YAML document parses into a value, then serializes to JSON with your chosen indentation. The conversion is a data conversion, not a byte-for-byte copy: comments are dropped, scalar styles are normalized, and key order is preserved from the source document.

# in: YAML -> JSON
service: techfixgen
versions: [2, 3]
owner:
  name: Ada Lovelace
enabled: true

# out:
{
  "service": "techfixgen",
  "versions": [2, 3],
  "owner": {
    "name": "Ada Lovelace"
  },
  "enabled": true
}

Supported syntax

Parsing uses the YAML 1.2 core schema. That includes scalars for strings, integers, floats, booleans, and null, block and flow collections, quoted strings, comments, anchors, aliases, and multi-document files.

  • Anchors and aliases (&name / *name, and merge keys) are resolved to their expanded values in the JSON output.
  • Tags beyond the core schema such as !!timestamp, !!binary, and !!set are not converted to JavaScript-specific types; the core schema applies instead.
  • Comments are ignored during parsing and do not appear in the JSON output.
  • Duplicate mapping keys are rejected with a parse error instead of silently keeping one.

Converting JSON to YAML

JSON is a subset of YAML's data model, so any valid JSON document converts cleanly. Values are written with YAML block style, string values are quoted only when needed, unicode is preserved, and a --- document marker is emitted when the value is a sequence.

Limits and safety

The parser runs in a restricted core-schema mode with duplicate-key detection and a cap on alias expansion, so untrusted configuration cannot build JavaScript objects or exhaust the page with deeply nested aliases. JSON cannot represent circular references, timestamps, or binary data, so documents that need those features cannot round-trip exactly.

Privacy

Conversion runs entirely in your browser. The YAML and JSON documents you paste are not uploaded to TechFixGen servers and are not included in analytics events. No account or signup is required. Need to check a JSON document first? Try the JSON Validator.

Frequently asked questions

Are YAML comments preserved when converting to JSON?

No. JSON does not support comments, so comments are dropped during the conversion. The conversion is a data conversion, not a byte-for-byte copy.

Does this converter support anchors and aliases?

Yes. Anchors (&name), aliases (*name), and merge keys are resolved to their expanded values, subject to a cap on alias expansion. The resulting JSON contains the fully expanded data.

What happens when a YAML mapping has duplicate keys?

Duplicate keys are rejected with a parse error rather than silently keeping the last value. This surfaces accidental overrides instead of hiding them.

Can JSON documents round-trip exactly through this converter?

Most JSON documents do, but circular references, timestamps, and binary data cannot be represented in JSON, so some YAML documents cannot be converted. Conversion also normalizes formatting, key representation, and scalar styles.

Which data types are recognized?

Parsing uses the YAML 1.2 core schema: strings, integers, floats, booleans, null, sequences, and mappings. Tags beyond the core schema, such as !!timestamp and !!binary, are not converted to JavaScript-specific types.

Is my YAML or JSON uploaded anywhere?

No. Conversion happens entirely in your browser. The documents you paste are not uploaded to TechFixGen servers and are not included in analytics events.