YAML to JSON Converter
Convert YAML to JSON, or JSON to YAML. Quoting is handled, so yes,
off, 1.0.0 and 2026-01-01 survive the round trip
with their types intact.
In-browser & private
Anchors, aliases and multi-document files are refused by name rather than half-parsed — wrong output is worse than a clear refusal.
YAML
JSON
Keys —
Depth —
Size 0 B
Ready
What the converter is careful about
- Types are preserved in both directions. This reader follows YAML 1.2, where only
trueandfalseare booleans — sooffstays the string"off". But SnakeYAML, which Spring Boot uses, follows YAML 1.1 and readsyes,no,onandoffas booleans. Those values are therefore always quoted on the way out, so a password ofoffcannot come back asfalsein your application. - The rest of YAML 1.1 is quoted too. The booleans are the famous half of that problem. A date such as
2026-01-01becomes aDate,12:30becomes750because 1.1 has sexagesimal integers, and1_000becomes1000. Each of those is quoted on the way out for the same reason. - Block scalars keep their ending.
|-,|and|+are three different strings, and the difference is the trailing newline — which matters for a script, a private key or a certificate. The indicator is read on the way in and chosen to match on the way out. - Spring configuration? The Properties to YAML converter turns an
application.propertiesinto anapplication.ymland back, using this same reader. - Version-like strings stay strings.
1.0.0is not a number and is left alone;1.0is, and is converted. - Multi-line strings become block scalars (
|-) rather than one long line full of\nescapes. - Empty collections are written in flow style.
key: []andkey: {}, because a barekey:reads back as null and that is a different document.
Frequently asked questions
- Is my file uploaded anywhere?
- No. Both directions run entirely in your browser. Nothing you paste leaves the page, so a
production
application.ymlwith real credentials is safe to convert here. - Why did my
offoryesvalue come back quoted? - Because Spring Boot reads YAML 1.1, where those words are booleans. Quoting them is what
keeps a password of
offfrom arriving in your application asfalse. The same applies to dates, times such as12:30and numbers written1_000. - What is not supported?
- Anchors, aliases, merge keys, explicit tags and multi-document files. Each is refused by name with the line number rather than half-parsed, because a document that converts into the wrong shape is worse than one that refuses to convert. Duplicate keys are refused for the same reason.
- Does JSON to YAML lose anything?
- No. Every JSON document converts to YAML and back to the same JSON, including multi-line strings, nested arrays, empty objects and values that look like numbers or booleans. Comments are the one thing that cannot survive, because JSON has nowhere to keep them.
- Why is a key with no value
nullrather than an empty object? - Because that is what YAML says it is, and what Spring will bind. Writing
key:on its own is how you say null; an empty map is writtenkey: {}, which is what this converter emits so the two cannot be confused.