Overview
Converts between YAML and JSON in both directions for the shapes that actually appear in service configuration: nested maps, typed scalars, inline arrays, and comments.
How It Works
Pick a direction. YAML to JSON walks the input by indentation, building nested objects and coercing scalars, so true and false become booleans, null and ~ become null, integers and decimals become numbers, bracketed lists such as [alpha, beta] become arrays, and # comment lines are dropped. JSON to YAML does the reverse with two-space indentation, keeping short scalar arrays inline and quoting any string containing YAML-significant characters. A parse failure reports the specific line it could not read instead of returning empty output.
Step-by-Step Usage Guide
- Choose YAML to JSON, or JSON to YAML.
- Paste the source document into the input pane.
- Read the converted result, or the line-specific error if the input cannot be parsed.
Technical Specifications & Standards
This handles a deliberate subset of YAML rather than the full specification. Indentation-nested mappings, scalar type coercion, inline flow sequences and comments are supported. Block sequences written as dashed lines, anchors and aliases, multi-document streams, and folded or literal block scalars are not. That covers most Docker Compose, CI pipeline and Kubernetes-style fragments you paste to check a structure, but for a file leaning on anchors or multi-line strings use a full YAML library in your own toolchain.
Targeted Use Cases
- Translating a Docker Compose fragment into JSON to inspect its structure programmatically.
- Converting a JSON config into YAML for a pipeline that only accepts YAML.
- Sanity-checking indentation in a config file where the nesting looks ambiguous.
- Turning an API JSON response into YAML to read it more comfortably.
Notes & Gotchas
- YAML nesting is whitespace-significant and tabs are not valid indentation. Tabs are the most frequent cause of a parse error.
- Unquoted yes, no, on and off are booleans to YAML 1.1 parsers. Quote them when you mean the literal strings.
- A leading-zero value such as 0755 may be read as octal by some parsers, so quote it when it is a file mode.
- JSON has no comments, so comments in YAML input are dropped on conversion and cannot be recovered coming back.
Frequently Asked Questions
Does it support dashed block lists?
Not currently. Sequences are supported in inline flow form such as [alpha, beta]; dashed multi-line sequences are outside the supported subset.
Does it support anchors and aliases?
No. Anchors, aliases and merge keys are not handled, so convert those with a full YAML library.
Why did I get a cannot-parse-line message?
That line is not a key-value pair the parser recognises, usually due to a tab character, a missing colon, or an unsupported construct.
Is the config uploaded?
No. Both directions run in your browser, so configs containing internal hostnames stay local.