HTML Tools

Free YAML JSON Converter

Convert between YAML and JSON bidirectionally. Paste YAML and get clean JSON, or paste JSON and get readable YAML. Handles nested objects, arrays, strings, numbers, booleans, and null values. Preserves data types during conversion. Useful for translating GitHub Actions workflows, Jekyll front matter, Docker Compose files, and application configs.

Loading tool...

What is YAML JSON Converter?

YAML JSON Converter is a bidirectional conversion tool that translates between YAML and JSON formats. YAML is widely used for configuration files (GitHub Actions, Docker Compose, CI/CD pipelines, static site front matter) while JSON is the standard for API communication and data storage. This tool preserves data types including strings, numbers, booleans, nulls, arrays, and nested objects during conversion.

quickAnswer

Paste YAML or JSON and convert in either direction. Data types are preserved -- strings, numbers, booleans, nulls, arrays, and nested objects all translate correctly. YAML anchors are expanded during conversion.

limitations

  • YAML anchors and aliases are expanded to literal values during conversion -- the reference structure cannot be preserved or recreated when converting back.
  • YAML block scalar styles (literal |, folded >) are normalized to quoted strings with escape sequences. The original formatting style is not preserved through a round-trip conversion.
  • YAML documents with multiple --- document separators are not supported. Only single-document YAML inputs are accepted for conversion.

How to use this tool

  1. Paste YAML or JSON into the input area. The tool auto-detects the input format.
  2. Click Convert to YAML or Convert to JSON to transform the data in either direction.
  3. Review the output for type fidelity -- strings stay quoted, numbers stay unquoted, booleans and nulls are preserved.
  4. Copy the converted output or clear and start over with new input.

What you can use it for

  • Translate a GitHub Actions workflow from YAML to JSON for programmatic validation or API submission.
  • Convert Jekyll or Hugo front matter from YAML to JSON for use in JavaScript-based static site generators.
  • Transform Docker Compose files between formats when migrating between compose tools that prefer different input formats.

Use cases

Practical examples

example

Converting GitHub Actions workflow to JSON

A developer maintains a GitHub Actions workflow in YAML but needs to validate the structure programmatically. They paste the workflow YAML into the converter, click Convert to JSON, and get a valid JSON representation ready for schema validation or API consumption.

example

Translating a Docker Compose file to YAML

A team receives a Docker Compose configuration in JSON format from a generation tool. They paste the JSON input, click Convert to YAML, and get a clean, readable docker-compose.yml ready for their project repository.

Common mistakes

  • Assuming all YAML anchors and aliases survive conversion to JSON -- JSON does not support anchors (&) or aliases (*). Anchored values are expanded to their literal values during YAML to JSON conversion.
  • Expecting YAML multiline strings (| and >) to round-trip perfectly -- JSON represents multiline strings with \n escape sequences. Converting back to YAML produces quoted multiline strings rather than the original block scalar style.
  • Forgetting that YAML treats unquoted values like yes, no, true, false, on, off as booleans -- these convert to boolean true/false in JSON. Quote YAML values if you need them as strings in the JSON output.

verification

  1. Paste a simple YAML object like name: Alice age: 30 active: true and click Convert to JSON. Confirm the output is {"name": "Alice", "age": 30, "active": true} with correct data types.
  2. Paste the JSON output back into the input and click Convert to YAML. Confirm the round-trip produces the original YAML structure (with formatting differences for multiline values).

FAQ

Questions about YAML JSON Converter

Does the tool support YAML anchors and aliases?

Yes, YAML anchors (&) and aliases (*) are resolved during conversion. The anchor value is expanded inline in the JSON output. JSON has no equivalent concept, so the reference structure is lost during YAML to JSON conversion. Convert back from JSON to YAML and all values remain as duplicates -- anchors are not recreated.

How does the converter handle YAML timestamps and dates?

YAML timestamps (2026-06-05, 2026-06-05T14:30:00Z) are converted to JSON strings. JSON has no native Date or Timestamp type. The string value preserves the original format so you can parse it on the receiving end.

Will unquoted YAML strings like port numbers or version strings remain as strings in JSON?

YAML interprets unquoted numeric-looking strings as numbers. A YAML value like 8080 becomes the JSON number 8080. If you need a numeric-looking value to remain a string, quote it in YAML: "8080" becomes the JSON string "8080". Similarly, yes, no, true, false, on, and off are interpreted as booleans unless quoted.

Related tools

More html tools

Html

ARIA Live Region Generator

Generate accessible ARIA live region HTML snippets with role, aria-live, aria-atomic, and aria-relevant attributes. Includes optional JavaScript update function.

Open tool

Html

CSP Hash Generator

Generate CSP hash values for inline scripts and styles. Hash exact code content with SHA-256, SHA-384, or SHA-512 and get the matching CSP directive snippet.

Open tool

Also try

Also try

Seo

AI Crawler robots.txt Builder

Build a robots.txt policy for AI crawlers. Choose from open, selective, or strict presets and block specific AI training bots while allowing search engines.

Open tool