Course – LS – All

Get started with Spring 5 and Spring Boot 2, through the Learn Spring course:


1. Overview

In this tutorial, we’ll learn how to convert the default file we receive when we download a new Spring Boot project from Spring Initializer to the more readable application.yml file.

2. Difference Between Properties and YML File

Before diving directly into the topic, let’s see the difference between these two file formats in the form of code.

In the file, properties are stored as a single-line configuration. Spring Boot generates the properties file as the default one:


On the other hand, we can create an application.yml. This is a YML-based file that is easy to read when having hierarchical data compared to the properties file:

    url: jdbc:h2:mem:testDB
    username: user
    password: testpwd

As we can see, with the help of YML-based configuration, we have removed the need to add repeated prefixes (spring.datasource).

3. Convert Properties to YML and Vice-Versa

3.1. IntelliJ Plugin

If we’re using IntelliJ as our IDE to run the Spring Boot application, we can do the conversion by installing the following plugin:


We need to go to File > Settings > Plugins > Install “Convert YAML and Properties file”.

Once we’ve installed the plugin, we:

  • Right-click on the file
  • Select the option “Convert YAML and Properties file” to convert the file to application.yml automatically

We’ll be able to convert it back as well.

3.2. Online Website Tool

Instead of installing plugins, we can also directly copy-paste the config from our codebase to the Mageddo converter website.

For security purposes, ensure we don’t enter passwords for conversion on third-party websites:Mageddo-Properties-To-YML

We put the code in the respective properties/YML section and converted it into another format.

4. Conclusion

In this tutorial, we’ve seen the difference between .properties and .yml files and learned how to convert the file to application.yml and vice-versa using various tools and plugins highlighted.

Course – LS – All

Get started with Spring 5 and Spring Boot 2, through the Learn Spring course:

res – REST with Spring (eBook) (everywhere)
Comments are closed on this article!