FormatterHQ

YAML to Properties Converter

Paste application.yml or any YAML mapping and get flat Java .properties lines. Nested keys are joined with dots and lists become key[0], key[1] entries by default.

Input YAML
Output INI
Ready.

How to use the YAML to Properties Converter

  1. Paste your YAML into the input editor.
  2. Pick the Array keys style: key[0] (Spring) or key.0.
  3. Click Convert.
  4. Copy the key=value lines or download them as a .properties file.

Flatten YAML with the YAML to properties converter

The YAML to properties converter walks a YAML document and writes one key=value line for every leaf value, joining parent keys with dots. It is the fastest way to see the full property name of a deeply nested setting, to pass values as -D system properties or environment overrides, or to move a Spring Boot project from application.yml back to application.properties.

Example

server:
  port: 8080
spring:
  datasource:
    url: jdbc:mysql://db:3306/shop
    password: ${DB_PASS}
  profiles:
    active: [dev, metrics]
app:
  motd: |
    Welcome
    to Acme
  owners:
    - name: Ann
      email: ann@example.com
  empty: null

Output with Spring-style array keys:

server.port=8080
spring.datasource.url=jdbc:mysql://db:3306/shop
spring.datasource.password=${DB_PASS}
spring.profiles.active[0]=dev
spring.profiles.active[1]=metrics
app.motd=Welcome\nto Acme\n
app.owners[0].name=Ann
app.owners[0].email=ann@example.com
app.empty=

Options explained

Array keys controls how list items are numbered. key[0] is the default because it is what Spring Boot's relaxed binding expects for lists and lists of objects, as in app.owners[0].name. key.0 suits generic tools that only understand dotted names; the example list would become spring.profiles.active.0=dev.

Why flatten YAML?

Nested YAML is pleasant to edit but awkward to override. Command-line flags such as --server.port=9090, test annotations like @TestPropertySource and many deployment dashboards all expect the full dotted name. Flattening the file once gives you a complete list of those names to copy from.

If both files exist in a Spring Boot project

Spring Boot reads application.properties and application.yml from the same locations, and when both files are present in one location, the .properties values take precedence. After converting, delete or rename the YAML file so nobody edits a file whose values are silently overridden.

To confirm that every property kept its name, compare the output with what the running application reports: with Spring Boot Actuator enabled, the /actuator/env endpoint lists each loaded property under the same dotted, indexed names this converter produces, for example spring.profiles.active[0].

Edge cases

  • Block scalars (| and >) are escaped into one line with \n, including the trailing newline that | keeps.
  • Placeholders such as ${DB_PASS} are copied as text; Spring resolves them the same way in both formats.
  • null values become empty (app.empty=).
  • YAML 1.2 rules apply. Dates like 2024-05-01 and words like yes or on stay plain text rather than being turned into timestamps or booleans.
  • Merge keys (<<: *defaults) are not expanded; the output contains a literal << segment. Inline the shared values before converting.
  • Multi-document files separated by --- are rejected. Split profile sections into separate inputs and convert each one.
  • Non-ASCII characters are written as \uXXXX escapes so the file loads correctly with Properties.load.

Going the other way? Use Properties to YAML. If your YAML does not parse, check it first with the YAML validator, or convert it to JSON with YAML to JSON to inspect the structure.

Privacy

Your YAML is converted in the browser and never uploaded.

Frequently asked questions

How do I convert application.yml to application.properties?
Paste the YAML, keep Array keys set to key[0] (Spring) and click Convert. Save the output as application.properties; Spring Boot binds the same property names from either file.
Why do my property keys contain a merge-key segment?
The converter follows YAML 1.2, which has no merge-key feature, so <<: *anchor is kept as an ordinary key and shows up as a << segment in the output. Copy the anchored values into each section before converting.
Can I convert a YAML file with several --- documents?
Not in one go. The parser expects a single document, so convert each profile section separately and label the output files, for example application-dev.properties.
How are multi-line strings written?
Line breaks become \n escapes so each property stays on one line. Java's Properties class turns them back into real line breaks when it loads the file.

Last updated September 26, 2026

Related tools