DockittDockitt

YAML to JSON Converter — Free Online Tool

Convert YAML to JSON format online. Handles all YAML types including anchors and aliases. Free, browser-based.

Runs entirely in your browser — no data leaves your device
No account, no signup, completely free
Instant results — no waiting for server processing
Works offline once the page is loaded
Runs entirely in your browser. Your text never leaves your device — no server, complete privacy.

YAML (YAML Ain't Markup Language) is a human-friendly data serialisation format widely used in configuration files — Docker Compose, Kubernetes manifests, GitHub Actions workflows, and many CI/CD systems use YAML. This tool converts YAML to JSON using the js-yaml library, which fully supports YAML 1.2 including anchors (&), aliases (*), multi-line strings, and all native YAML types. The JSON output is prettily formatted and ready to use.

How to use

  1. Paste your YAML document into the input textarea.
  2. Click 'Convert to JSON' to parse the YAML and generate the JSON output.
  3. Copy the JSON to clipboard or download it as a .json file.

FAQ

What YAML features are supported?

The js-yaml library supports the full YAML 1.2 specification including: scalars (strings, numbers, booleans, null), sequences (lists), mappings (objects), multi-line string literals (|) and folded strings (>), anchors (&name) and aliases (*name), explicit type tags (!!str, !!int, !!float, !!bool, !!null, !!seq, !!map), and comments (which are stripped from the JSON output as JSON does not support comments).

How are YAML types mapped to JSON types?

YAML strings become JSON strings. YAML integers and floats become JSON numbers. YAML true/false become JSON true/false. YAML null and ~ become JSON null. YAML sequences become JSON arrays. YAML mappings become JSON objects. YAML timestamps (dates) are converted to ISO 8601 strings in the JSON output.

What are YAML anchors and aliases, and are they supported?

Anchors (&name) mark a node for reuse, and aliases (*name) reference a previously defined anchor. This allows you to avoid repetition in YAML — define a block once and reference it multiple times. The js-yaml library fully resolves anchors and aliases before converting to JSON, so the output JSON contains the fully expanded value at each alias location.

Can I convert Kubernetes or Docker Compose YAML files?

Yes. Kubernetes manifests and Docker Compose files are standard YAML documents. Paste the content of any .yaml or .yml file and it will be converted to JSON. Note that Kubernetes manifests often use multi-document YAML (multiple documents separated by ---). This tool processes only the first document if multiple are present.

What happens to YAML comments?

YAML comments (lines starting with # or inline # text) are stripped during parsing and do not appear in the JSON output. JSON does not support comments, so this is unavoidable. If you need to preserve comments, consider adding them as dedicated string fields in your YAML before converting.

Is the conversion done in my browser or on a server?

The conversion runs entirely in your browser using the js-yaml library. No data is sent to any server. This is important for YAML files that may contain API keys, credentials, connection strings, or other secrets in your configuration files.