How to convert YAML to properties
A .properties file is a flat list of key=value lines. YAML nests keys inside each other. To convert yaml to properties, the tool joins the names of every level with dots, so a port inside a server group becomes server.port.
This YAML has a number, a list and a text block:
server:
port: 8080
app:
version: 1.0
origins:
- https://example.com
- https://admin.example.com
motd: |
Welcome
to the shopThe converter writes:
server.port=8080
app.version=1.0
app.origins[0]=https://example.com
app.origins[1]=https://admin.example.com
app.motd=Welcome\nto the shop\nNotice that 1.0 stays 1.0. Numbers and booleans are written exactly as they appear in the YAML, so a version number is not turned into 1. The text block ends with a line break, and that break is kept as \n.
Convert application.yml to application.properties for Spring Boot
Spring Boot reads application.yml and application.properties with the same key names, so the flat keys here are the ones your code binds. To convert application.yml to application.properties, paste the file and download the result as application.properties.
Lists use the indexed form, such as app.origins[0]. Spring Boot reads that form for lists of text and for lists of objects. If you prefer one line for a list of plain values, switch Lists to Comma joined. A list whose items contain commas, spaces at the edges or line breaks falls back to indexed keys, and the notes say so.
Several documents and profiles in one YAML file
A YAML file can hold several documents separated by a --- line. Spring Boot uses this to put profile settings in one file. With Document set to all, each document is written in turn and a #--- line is put between them. Spring Boot 2.4 and later reads #--- as a document break in a properties file.
a=1
#---
spring.config.activate.on-profile=prod
server.port=80The Documents list in the notes shows each document's number, its key count and its profile name when it has one. To get a single file for one profile, type its number into Document, for example 2. An empty document, such as a lone --- at the end of the file, is skipped.
Anchors, merge keys and empty values
Anchors and aliases are resolved, and so are merge keys written as <<: *name. Keys written next to a merge key win over merged ones, as in YAML itself.
base: &base
retries: 3
server:
<<: *base
port: 80base.retries=3
server.port=80
server.retries=3A properties file has no null. An empty or null value is written as a key with nothing after the equals sign, and the notes list it with its line number. An empty map or list is written the same way and listed too. An alias that points to an anchor that does not exist stops the conversion with a message that names it.
Escaping, UTF-8 and multi-line text
Inside keys the tool escapes spaces, equals signs, colons and a leading # or !. In values it escapes backslashes, line breaks, tabs and a leading space. Other characters, including = and :, are left alone so the file stays readable.
Spring Boot reads properties files as UTF-8, so the default keeps accents and other scripts as they are. Older Java code that loads a file as Latin-1 needs \uXXXX codes instead. Set Non-ASCII characters to Write as \uXXXX and the word café becomes caf\u00E9, a Chinese character becomes \u4E16 and an emoji becomes a surrogate pair.
name=caf\u00E9
zh=\u4E16\u754CText with line breaks is written on one line with \n by default. The Continuation lines option writes each line on its own row, ending with a backslash, which is easier to read in a long message:
motd=Welcome\n\
to the shopLimits: what this converter does not do
- A key that already contains a dot, such as "a.b", is written as it is. Spring reads it as a path, and the notes warn you.
- Placeholders like ${name} stay as text. Nothing is resolved.
- Custom YAML tags are ignored and their values kept as plain text.
- A file that expands to more than 300,000 lines through aliases is refused, because that size usually means an alias loop.
- Environment-variable style names such as SERVER_PORT are not produced.
To go the other way, use Properties to YAML.
Privacy
Config files often hold passwords and tokens. The conversion runs in your browser and the text is not uploaded. The Privacy Policy explains what the site stores. Replace real secrets with placeholders before you share a file.
Related converters
Try YAML to JSON and JSON to YAML for JSON configs, and TOML to JSON when a project uses TOML.