Properties to YAML Converter

Convert application.properties to application.yml and back — indexed keys become lists, and types are handled the way Spring binds them.

In-browser & private
Advertisement

Comments are not carried across: a properties comment has no unambiguous home in the nested YAML it becomes, and inventing one would move it somewhere wrong.

application.properties
application.yml
Properties — Depth — Size 0 B Ready

How the two shapes line up

  • Dots become nesting. spring.datasource.url is three levels of YAML, which is the whole reason the file is easier to read.
  • Indexed keys become lists. app.origins[0] and [1] turn into a YAML sequence — the form Spring binds a List<String> from.
  • Types are inferred the way Spring binds them. 8080 becomes a number and true a boolean, but 1.0.0 stays a string, and anything ambiguous is quoted on the way out.
  • A colon in a value is safe. jdbc:mysql://… is one value, not a nested key, in both directions.
  • Escapes are read the way Java reads them. \n, \t, \uXXXX, an escaped separator such as a\:b, and a line continued with a trailing backslash all mean here what they mean to java.util.Properties — so a Windows path like C:\\new arrives intact.
  • A key cannot be both a value and a prefix. a=1 beside a.b=2 is refused with both line numbers, because only one of them could survive and picking silently would drop a setting you can plainly see in the file.
  • Everything else survives. A properties file converted to YAML and back is identical, comments aside — including escaped keys, nested lists and values that look like numbers.

Converting between YAML and JSON instead? The YAML to JSON converter shares this YAML reader and writer.

Frequently asked questions

Is my configuration uploaded anywhere?
No. Both directions run entirely in your browser. Nothing you paste leaves the page, so a real application.properties with credentials in it is safe to convert.
Why did 0777 stay a string while 8080 became a number?
Because the leading zero is part of the value. A PIN of 0777 is not the number 777, so anything padded is left as text. Plain integers, decimals and true/false are converted, which is what Spring does when it binds them.
What happens to an empty list or a null?
A properties file has no way to write either, so both become a key with an empty value. The key survives the trip, but converting back gives you an empty string rather than the empty list or the null you started with. Going the other way, app.origins= is what Spring binds an empty list from.
Are comments carried across?
No. Neither format attaches a comment to a particular value, so there is nowhere to put them. Everything else survives: a properties file converted to YAML and back is identical.
Which file should a Spring Boot project use?
Either. Spring Boot reads both and binds them identically, so it is a readability choice. YAML suits deep, repetitive configuration; properties suit a short file, and are easier to override from an environment variable or the command line.

More free tools