免费工具
YAML ↔ JSON Converter
Convert YAML to JSON or JSON to YAML instantly. Paste your input, see the result in real time, and copy or swap directions with one click.
YAML
JSON
JSON output will appear here
When to use YAML vs JSON
YAML is preferred for configuration files — GitHub Actions, Kubernetes, Docker Compose — because it is human-readable. JSON is the standard for REST APIs.
What is preserved
All values, types (strings, numbers, booleans, nulls), nested objects, and arrays are preserved. YAML comments are dropped. Anchors and aliases are resolved.
How to use
- Select YAML → JSON or JSON → YAML.
- Paste your content.
- The output appears instantly.
- Click Copy or Swap & flip.
Conversion runs in your browser using js-yaml — nothing is uploaded to any server.
常见问题
- What is the difference between YAML and JSON?
- Both represent structured data. JSON uses braces and quotes; YAML uses indentation. YAML is a superset of JSON. YAML is common in config files; JSON is standard for APIs.
- Does YAML to JSON conversion lose information?
- Comments are stripped. Anchors and aliases are resolved to their full values. All data values are preserved.