Logo JSON Parser Online

Convert YAML to JSON Online

Paste YAML and click Convert. The tool uses the js-yaml library to parse your YAML document and output valid, pretty-printed JSON. Handles real-world YAML including anchors, multi-line strings, and type tags.

All JSON Tools

28 tools

Free, fast, runs in your browser. No login needed.

Made with ❤️ in India · © 2025 parsejsononline.com
INPUT
1
OUTPUT
1
✅ Ready
Characters: 0
Ctrl+Enter to run
What is this tool?

How to use

  1. Paste your YAML into the INPUT pane.
  2. Click Convert.
  3. The output pane shows the equivalent JSON, formatted with 2-space indentation.
  4. Click Copy or Download to use the result.

How it works

This tool uses js-yaml 4.1.0, a widely-used, spec-compliant YAML parser. It handles the full range of YAML features that appear in real configuration files:

  • Anchors and aliases — &anchor and *alias references are resolved during parsing, producing the expanded value in JSON.
  • Multi-line strings — both literal block (|) and folded (>) scalars are parsed correctly.
  • YAML types — !!str, !!int, !!bool, !!null, !!float type tags are respected.
  • Dates — YAML date scalars (e.g., 2024-01-15) are parsed as JavaScript Date objects and become ISO string values in the JSON output.

Important: YAML is a superset of JSON. Any valid JSON is also valid YAML, so you can paste JSON into this tool and it will pass through correctly.

Output format. The JSON output is formatted with 2-space indentation via JSON.stringify(result, null, 2). Use the JSON Formatter if you prefer a different indent width, or the JSON Minifier to strip whitespace.

Common use cases: converting a Kubernetes manifest or Docker Compose file for programmatic inspection; converting Ansible variable files or GitHub Actions workflow YAML to JSON for querying; migrating data between YAML and JSON-native systems.

FAQ

What YAML features are supported?

Full YAML 1.2 via js-yaml: anchors and aliases, multi-line block and folded scalars, type tags (!!str, !!int, !!bool, etc.), nested mappings and sequences, and multi-document files (only the first document is parsed).

What happens to YAML anchors in the output?

Anchors and aliases are expanded by the parser. The JSON output contains the full resolved value at every alias location — there are no references in JSON.

Can I convert back from JSON to YAML?

Yes. Use the JSON to YAML tool on this site.

What if my YAML has multiple documents (--- separators)?

js-yaml's load() function reads the first document only. Multi-document YAML streams are not merged into a JSON array.

Is my data sent anywhere?

No. The conversion runs entirely in your browser using the bundled js-yaml library.

Related tools

JSON to YAMLConvert JSON back to YAML format. JSON FormatterFormat the JSON output with custom indentation. JSON ValidatorValidate the converted JSON for syntax correctness.