How to use the Properties to YAML converter
- Paste a
.propertiesfile into the left pane, typically Spring Boot’sapplication.properties. The YAML appears as you type. - Copy or Download the result as
application.yml.
Errors such as a malformed \uXXXX escape or a key used as both a value and a group point to the line in the original file.
Example
spring.application.name=order-service
server.port=8081
spring.datasource.url=jdbc:postgresql://localhost:5432/orders
spring.datasource.hikari.maximum-pool-size=10
app.cors.allowed-origins[0]=https://tidypane.dev
app.cors.allowed-origins[1]=http://localhost:3000
app.greeting=Xin chào
becomes
spring:
application:
name: order-service
datasource:
url: jdbc:postgresql://localhost:5432/orders
hikari:
maximum-pool-size: 10
server:
port: 8081
app:
cors:
allowed-origins:
- https://tidypane.dev
- http://localhost:3000
greeting: Xin chào
How keys are nested
- Dots separate levels:
spring.datasource.urlbecomesspring:→datasource:→url:. [0],[1]become list items, and they can be combined with dots, as inservers[0].host.- Order is kept: groups appear in the order their first key appears in the file.
- Duplicate keys: the last value wins, as in Java, and a warning lists both line numbers.
Why switch to YAML
application.yml groups related settings under one heading, so a long file of repeated spring.datasource. prefixes becomes much easier to scan. Lists are clearer too, and YAML supports several profiles in one file separated by ---. The flat format is still handy for one-off overrides, so many teams keep YAML for the main file and use flat keys only on the command line or in environment variables. Converting back and forth with this tool and its reverse is lossless for ordinary settings.
Things to check after converting
- Profiles. Spring Boot reads
application-dev.propertiesandapplication-dev.ymlthe same way, so you can convert each profile file separately, or combine them into one YAML file with---andspring.config.activate.on-profile. - Placeholders such as
${DB_URL:localhost}are copied as plain text and still work in YAML. - Values that look like other types. A value like
on,yesor0755is kept as written, but quote it in YAML if another tool reads the file with YAML 1.1 rules. - Precedence. If both
application.propertiesandapplication.ymlexist, Spring Boot loads both and the.propertiesfile wins on conflicts, so delete the old file after switching.
Related tools
Going the other way? Click Reverse or open YAML to Properties. To check the resulting YAML or see it as JSON, use YAML to JSON, and to convert between other formats use the Data Format Converter.
Frequently asked questions
Will Spring Boot read the YAML the same way?
Yes for the usual cases. Dotted keys become nested maps and indexed keys like allowed-origins[0] become YAML lists, which Spring Boot binds to the same properties. Numbers and true/false are written unquoted for readability; Spring converts them to the target type either way.
Which .properties syntax is supported?
The full java.util.Properties rules: key=value, key: value and key value separators; # and ! comment lines; long values continued with a trailing backslash; escapes such as \t, \n, \= and \: ; and Unicode escapes like \u00e0. Keys and values are unescaped before they are written to YAML.
Why do I get "is also used as a group"?
The file sets a key both to a value and as a parent of other keys, for example server=on and server.port=8081. YAML can't hold both on the same key, so the tool stops and names the line. Rename one of the keys.
What about gaps in list indexes?
If a list skips an index, for example items[0] and items[2], the missing entry is filled with null and a warning says how many gaps there were. Indexes above 10,000 are rejected as likely typos.
Is my config uploaded?
No. Conversion runs in your browser, so database URLs and passwords in application.properties never leave your device.
Last updated