How to use YAML to JSON
- Paste YAML or choose a local .yaml or .yml file.
- Choose indentation, key sorting, and how multiple documents should be emitted.
- Review conversion warnings, then copy or download the valid JSON output.
Supported behavior
YAML to JSON safely parses one or more YAML documents and serializes values that JSON can represent. Output can use two-space, four-space, or tab indentation, sort keys, and present multiple documents as one JSON array or separate blocks. Date-like strings remain strings by default rather than silently becoming Date objects. The parser disables executable custom tags and arbitrary object construction, limits aliases, and reports circular references. Non-string map keys are stringified with a warning, while YAML-only types are converted predictably or rejected with a specific explanation. Every successful result is valid JSON. Pasted YAML and local .yaml or .yml files are parsed entirely in your browser and are never uploaded. YAML supports features that JSON does not, including aliases, complex keys, and specialized scalar types, so conversion can lose source comments, anchors, formatting, and type distinctions even when the data values convert successfully. Inspect warnings before relying on the result as an exact round trip.
- Comments, anchors, aliases, and original YAML formatting cannot be represented in ordinary JSON output.
- Complex YAML types may require warning-backed conversion or may be rejected when no safe JSON mapping exists.
Examples
service: api
replicas: 3
enabled: true
Result: { "service": "api", "replicas": 3, "enabled": true }
name: first
---
name: second
Result: [ { "name": "first" }, { "name": "second" } ]
Common use cases
- Convert a YAML configuration into JSON for a browser-based consumer.
- Inspect every document in a multi-document YAML stream as an array.
- Preserve date-looking identifiers as strings during a local migration.
Frequently asked questions
Can YAML custom tags run code?
No. Executable custom tags and arbitrary object construction are disabled.
Are multiple YAML documents supported?
Yes. Convert all documents to a JSON array or to separate JSON blocks.
What happens to a date-looking scalar?
Preserve-date-like-strings is on by default, avoiding an automatic Date conversion.
Are aliases unlimited?
No. Alias counts are limited to reduce expansion risks, and circular references produce a clear error.

