YAML to JSON Converter
Convert YAML configs, manifests, or snippets to clean JSON. Zero external dependencies.
About This Tool
YAML configs, Kubernetes manifests, and CI pipeline files need to become plain JSON for a script, an API
call, or a test fixture. This tool runs a lightweight hand-written YAML parser over your input, nested
mappings, lists, comments, booleans, and null/~: and emits formatted JSON.
It is not a full YAML 1.2 implementation: anchors/aliases, multi-document files, and complex block scalars aren't supported. For JSON that just needs reformatting rather than a format change, use JSON Formatter; for the reverse direction, see JSON to YAML.
Key Features
- Bidirectional conversion: one Direction dropdown (or the ⇌ swap button) switches between YAML → JSON and JSON → YAML.
- Configurable JSON indent: 2 spaces, 4 spaces, or minified output for the YAML → JSON direction.
- Handles comments -
#comments in the source YAML are parsed out and don't appear in the JSON output. - Loose boolean recognition: recognizes
true/falseas well as YAML'syes/noshorthand. - File upload & drag-and-drop: load a
.yaml,.yml,.json, or.txtfile directly. - Keyboard-driven: Cmd/Ctrl+Enter converts, Cmd/Ctrl+Shift+C copies the output.
Example
A YAML service definition with a nested map and a list:
name: api-gateway port: 8080 env: NODE_ENV: production tags: - auth - gateway
produces:
{
"name": "api-gateway",
"port": 8080,
"env": { "NODE_ENV": "production" },
"tags": ["auth", "gateway"]
} FAQ
- Can I convert JSON back to YAML?
- Yes! Click the ⇌ swap button or toggle the Direction dropdown to convert JSON objects back into YAML.
- What does the JSON Indent option control?
- Only the output spacing for YAML → JSON (2 spaces, 4 spaces, or minified). The reverse direction, JSON → YAML, always writes fixed 2-space indentation.
- What YAML features are supported?
- Nested mappings, lists, comments (
#, stripped on parse), quoted strings, booleans (true/false/yes/no), andnull/~. This is a lightweight hand-written parser, not a full YAML 1.2 implementation, anchors/aliases, multi-document files, and complex block scalars aren't supported. - Can I upload a file instead of pasting?
- Yes. Use the Upload button or drag-and-drop a
.yaml,.yml,.json, or.txtfile onto the input panel. - Does any of this leave my browser?
- No. Parsing and conversion run entirely client-side with zero external dependencies.