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
Advertisement

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 true and false are booleans — so off stays the string "off". But SnakeYAML, which Spring Boot uses, follows YAML 1.1 and reads yes, no, on and off as booleans. Those values are therefore always quoted on the way out, so a password of off cannot come back as false in 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-01 becomes a Date, 12:30 becomes 750 because 1.1 has sexagesimal integers, and 1_000 becomes 1000. 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.properties into an application.yml and back, using this same reader.
  • Version-like strings stay strings. 1.0.0 is not a number and is left alone; 1.0 is, and is converted.
  • Multi-line strings become block scalars (|-) rather than one long line full of \n escapes.
  • Empty collections are written in flow style. key: [] and key: {}, because a bare key: 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.yml with real credentials is safe to convert here.
Why did my off or yes value come back quoted?
Because Spring Boot reads YAML 1.1, where those words are booleans. Quoting them is what keeps a password of off from arriving in your application as false. The same applies to dates, times such as 12:30 and numbers written 1_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 null rather 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 written key: {}, which is what this converter emits so the two cannot be confused.

More free tools