Converters
YAML to Properties Converter
Flatten application.yml into application.properties — dotted paths, Spring's key[0] list convention, and the ISO-8859-1 \uXXXX escaping Java's Properties loader expects.
In short
Convert YAML to Java .properties online: nested keys flattened to dotted paths, lists as key[0] or comma-joined, \uXXXX escaping for Spring Boot — in your browser.
By NaveenKumar T · Updated
Learn: TOML vs YAML vs JSON: Choosing a Configuration Format
- Instant in-browser conversion
- Validates input first
- Spring Boot list style (key[0]) or comma lists
Runs entirely in your browser — nothing you paste or open here is uploaded, logged, or stored.How we handle data →
Example
YAML to Properties: input and output
A Spring Boot application.yml: a plain nested key, a list of scalars, a list of mapping profiles, and a value with accented characters — each one exercising a different flattening rule.
server:
port: 8080
spring:
datasource:
url: jdbc:mysql://db:3306/shop?useSSL=false
profiles:
include: [db, cache]
app:
endpoints:
- name: health
path: /healthz
- name: metrics
path: /metrics
greeting: "Grüß dich, Zoë"
logging:
level:
org.springframework: WARNserver.port=8080
spring.datasource.url=jdbc:mysql://db:3306/shop?useSSL=false
spring.profiles.include[0]=db
spring.profiles.include[1]=cache
app.endpoints[0].name=health
app.endpoints[0].path=/healthz
app.endpoints[1].name=metrics
app.endpoints[1].path=/metrics
app.greeting=Gr\u00fc\u00df dich, Zo\u00eb
logging.level[org.springframework]=WARNThe endpoints list became app.endpoints[0].name / [0].path / [1].name / [1].path because it holds mappings, while profiles.include (a plain scalar list) is still written the same index way since index mode was selected. The JDBC URL survives untouched — its colon and equals-free syntax needs no escaping — and ü/ß in the greeting became \u00fc/\u00df.
Learn more
How YAML to Properties conversion works
Every mapping key becomes a segment of a dotted property name, walked depth-first with order preserved: server: { port: 8080 } becomes server.port=8080, and a three-level nested mapping becomes a three-segment dotted key. A YAML key that isn't a legal bare property-name fragment — one containing a dot, a slash, a space, or another character outside letters, digits, underscore and hyphen — is written in Spring's bracket form instead, so a key literally named api.timeout (quoted in YAML to keep it one key) becomes [api.timeout] rather than being mistaken for two nesting levels.
Lists follow whichever convention you pick, because Spring Boot's relaxed binding actually supports two of them. Index form — the default, and the only one that survives objects inside a list — numbers each element: servers[0].host, servers[1].host. Comma form joins a list of plain scalars into one line, roles=admin,editor, which reads better and binds fine to a List<String> but cannot represent a list of nested objects; ask for it on a list containing mappings and this tool falls back to index form for that list and says so in the status line.
What a .properties file simply cannot hold: comments (YAML's # lines have no equivalent and are dropped), anchors and aliases (resolved to their expanded values before flattening, same as this site's YAML to JSON), and the merge key << (also expanded here, unlike the YAML to JSON converter, which deliberately preserves << as a literal key — a bare << would otherwise become a garbage property name with no meaning outside YAML). Multiple YAML documents in one file (separated by ---) are supported too: each becomes its own block of properties, separated by a #--- comment line, which is the convention Spring Boot 2.4+ uses for multi-profile .properties files.
When to convert YAML to Properties
The two directions that actually come up: migrating a Spring Boot service's configuration from application.yml back to application.properties (some teams standardize on one format per environment, or a legacy deployment tool only reads .properties), and generating a .properties file for tooling that never learned YAML — Log4j2 configuration, JDBC connection properties, Quartz scheduler config, and Maven resource filtering all still expect the flat key=value format. It is also a fast way to read a deeply nested YAML block as a flat list of exact keys, which is sometimes easier to diff or grep than indentation.
YAML construct → .properties line
A quick reference for what each YAML shape becomes, since the mapping rules above cover the reasoning but not every case at a glance.
| YAML construct | .properties output |
|---|---|
| Nested mapping | Dotted path: a: { b: 1 } → a.b=1 |
| List of scalars (index mode) | servers[0]=a\nservers[1]=b |
| List of scalars (comma mode) | servers=a,b |
| List containing a mapping | Index mode only: items[0].sku=A |
| null / ~ | Empty value: field= |
| Boolean true/false | Literal text: enabled=true |
| Multi-line block string | Escaped to one line with \n |
| Key with a dot or slash | Bracket form: [api.timeout]=30 |
Help
Frequently asked questions
Everything you need to know about the YAML to Properties.
01Does the output preserve the order my YAML keys were written in?
Property lines follow a depth-first walk of the YAML in its original key order, so server.port appears before spring.datasource.url exactly when server was written before spring in the source — nothing is alphabetised. That makes a diff against a previous .properties export meaningful, since only genuine content changes move a line.
02How are YAML lists written in .properties?
Two ways, and Spring Boot's relaxed binding actually accepts both for a simple List<String> or List<Integer>: index form (servers[0].host=api-1, servers[1].host=api-2 — the default here) and comma form (roles=admin,editor). The difference matters once the list holds objects rather than scalars: List<Address> or similar needs index form, because there is no way to comma-join a nested object onto one line, so comma mode automatically falls back to index form for exactly those lists and reports it in the status message. An empty list is written as endpoints= in comma mode (an explicit empty value) and simply omitted in index mode, since there is no index 0 to write — also reported in the message.
03Why are ü and ß written as \u00fc and \u00df?
Because java.util.Properties.load(InputStream) — the constructor every plain .properties file is defined against — is specified to read the stream as ISO-8859-1, a single-byte encoding that has no representation for ü, ß, emoji, or most non-Latin scripts, so the historical convention is to write anything outside printable ASCII as a \uXXXX escape and let the loader decode it back to the real character. Spring Boot's own .properties loader follows the same convention by default. If your loader is one of the exceptions — Properties.load(Reader) (which reads whatever encoding the Reader was opened with, usually UTF-8), or a framework loader like Quarkus/SmallRye Config that explicitly reads .properties as UTF-8 — switch this tool's Unicode option to "Write UTF-8 characters as-is" and the output keeps ü and ß literally instead of escaping them.
04What happens to comments, anchors and merge keys?
All three are YAML-only concepts with no .properties equivalent, so all three are gone in the output. Comments are simply dropped — there is nowhere to put them in the flat format. Anchors (&name) and their aliases (*name) are resolved to the actual value they point to before flattening runs, so two services that both wrote options: *defaults in YAML end up as two separate, fully-expanded blocks of properties rather than sharing a reference. The << merge key is expanded the same way — its mapping is merged into the surrounding block and the literal << key never appears in the output, unlike this site's YAML to JSON converter, which keeps << verbatim because JSON has no concept of merging either but at least a literal << key does no harm there.
05My YAML key contains a dot or a slash — how is it written?
In Spring's bracket form: a key that doesn't match a plain bare identifier — because it contains a dot, a slash, a space, or a character outside letters, digits, underscore and hyphen — is wrapped in [ ] rather than joined with a dot, so it can't be confused with an extra level of nesting. A top-level key "api.timeout": 30 becomes [api.timeout]=30, and the same rule applies one level deep: settings: { "/health": true } becomes settings[/health]=true. This exactly mirrors how Spring's relaxed binding reads such keys back: my.map[/api] binds to a Map<String, ?> entry keyed by the literal string "/api".
06Does converting back with Properties to YAML restore the original YAML exactly?
Structure and values come back correctly for what survived the trip: dotted and bracketed keys unflatten into the same nesting, and indexed lists rebuild into sequences. What's gone for good is what this converter already discarded — comments (unless a # line sat directly above a key, which Properties to YAML does reattach), anchors and aliases, and whether a list was written as index form or comma form in the source, since both become the same plain sequence.
Keep working
Related tools
Properties to YAML
Converters
YAML to JSON
Converters
YAML Validator
Full YAML 1.2 validation with the exact line and column of every error — catch the indent bug before your pipeline does.
Java Escape
Java-ready string literals from any text — full \uXXXX Unicode escaping for clean, ASCII-safe source files.
CSV to YAML
Converters
JSON to YAML
Converters