YAML to Properties

application.yml → application.properties, done right.

Runs in your browser Instant No sign-up
YAML input
.properties
Reverse

Paste, type or drop a file — output appears as you type.

Waiting for input
Processed locally · nothing is uploadedProcessed locally

How to use the YAML to Properties converter

  1. Paste a YAML file into the left pane, typically Spring Boot’s application.yml. The properties appear as you type.
  2. Escape non-ASCII (\uXXXX): on by default, for loaders that read ISO-8859-1.
  3. Copy or Download the result as application.properties.

YAML syntax errors are reported with their line and column.

Example

spring:
  application:
    name: order-service
  datasource:
    url: jdbc:postgresql://localhost:5432/orders
server:
  port: 8081
app:
  cors:
    allowed-origins:
      - https://tidypane.dev
      - http://localhost:3000
  greeting: Xin chào

becomes

spring.application.name=order-service
spring.datasource.url=jdbc:postgresql://localhost:5432/orders
server.port=8081
app.cors.allowed-origins[0]=https://tidypane.dev
app.cors.allowed-origins[1]=http://localhost:3000
app.greeting=Xin chào

Escaping rules

The output follows the rules java.util.Properties uses when it saves a file:

  • In keys, spaces and the characters =, :, # and ! are escaped with a backslash.
  • In values, a leading space and a leading # or ! are escaped, so they aren’t trimmed or read as comments.
  • Backslashes, tabs and newlines become \\, \t and \n.
  • null values and empty lists or maps are written as an empty value (key=), so the key still exists.

Limits

  • The top level of each YAML document must be a mapping, because a .properties file is a list of key/value pairs.
  • Comments in the YAML are not carried over.

When to use it

  • Teams or tools that expect .properties. Some deployment pipelines, older Spring versions and config servers only read the flat format.
  • Overriding a single setting. The flat key, such as spring.datasource.hikari.maximum-pool-size, is exactly what you pass on the command line (--spring.datasource.hikari.maximum-pool-size=20) or turn into an environment variable (SPRING_DATASOURCE_HIKARI_MAXIMUMPOOLSIZE).
  • Searching configuration. Flat keys are easy to grep across many services, while YAML spreads one setting over several lines.
  • Reviewing changes. A diff of two flat files shows each changed setting on its own line with its full name, which is often easier to review than an indented YAML diff.

The order of keys follows the YAML file, and every list item gets its own numbered key, so the output can be pasted back into a Spring Boot project as is.

Going the other way? Click Reverse or open Properties to YAML. To check the YAML first, use YAML to JSON. For .env files, use JSON to .env, and for any other pair of formats use the Data Format Converter.

Frequently asked questions

Why are accented characters written as \u00e0?

Spring Boot, like java.util.Properties, reads .properties files as ISO-8859-1, so characters outside basic ASCII must be written as \uXXXX escapes or they turn into garbage. Escaping is on by default. Turn off "Escape non-ASCII" if your loader reads the file as UTF-8, as Java 9+ resource bundles do.

How are YAML lists written?

As indexed keys: a list under app.cors.allowed-origins becomes app.cors.allowed-origins[0]=…, app.cors.allowed-origins[1]=… and so on, which Spring Boot binds back to a List. Lists of maps work too, for example servers[0].host=…

What happens to a YAML file with several documents?

Each document is written in turn, separated by a #--- line. Spring Boot 2.4 and later reads #--- as a document separator in .properties files, so profile-specific sections keep working.

What happens to anchors, aliases and merge keys?

They are resolved first, with the same parser as the YAML to JSON tool, so every key gets its effective value. The .properties file contains the expanded values.

Is my config uploaded?

No. Conversion runs in your browser and nothing you paste leaves your device.

Last updated