🍃 Properties ↔ YAML
Convert Spring Boot config both ways — lists, profile blocks and escapes included, without corrupting your version numbers.
Paste .properties on the left
Lists · profile blocks · escapes · 100% privateapplication.properties and application.yml
Spring reads both, and every team eventually moves from one to the other — usually to YAML, for the nesting, and occasionally back, because a flat file diffs better and cannot be broken by an indentation mistake. The conversion looks trivial and is not, because the two formats do not describe the same set of documents.
A flat file has no structure
server.port=8080 has no more structure than serverport=8080 does; the dots are a convention Spring's relaxed binder interprets, not syntax. Turning that into YAML means inventing a tree, and there is exactly one case where that is impossible: a key that is both a value and a prefix. app=1 alongside app.name=x is legal .properties with no YAML form at all, and it is reported rather than silently resolved.
Types are where configs get corrupted
Everything in .properties is a string; YAML has real scalars. So port=8080 should become a number — but version=1.10 must not, because as a number it is 1.1. Nor should enabled=on become true: YAML 1.1 says it is a boolean and Spring does not. Values are only converted when the text survives the round trip unchanged.
Profile blocks
Spring Boot 2.4 introduced #--- as the profile separator inside a .properties file, matching YAML's ---. Ignoring it merges every profile into one map, which looks right and lets the last block win — putting prod settings into dev. Each block is kept as its own document in both directions.
Frequently asked
Why did my version number stay quoted?
Because 1.10 as a YAML number is 1.1, and a version that changes value between two config files is corruption nobody goes looking for. Anything whose text does not survive a round trip through a number — 1.10, 007, 1e5 — is kept as a string.
Why is enabled=on still a string?
YAML 1.1 reads on, off, yes and no as booleans. Spring does not. Converting them would change what your application actually sees, so they stay strings.
What does the #--- separator do?
It is Spring Boot 2.4+'s profile-document separator inside a .properties file, and the equivalent of --- in YAML. A converter that ignores it collapses every profile block into one map, which looks correct and lets the prod block silently overwrite dev. Each block becomes its own YAML document here, and back again.
What is a "both a value and a prefix" warning?
app=1 and app.name=x together are legal in .properties and have no YAML form at all — a key cannot be a string and a map at once. Rather than silently pick one, the conflict is reported so you can decide which one you meant.
Are comments preserved?
No. Comments have no representation in the parsed structure, so they are dropped on the way through. This is the one thing to re-add by hand after converting a file you intend to keep.