100% local — your data never leaves your browser

YAML to .properties — Java Reads It Back

Flatten YAML into a Java .properties file. The escaping is done for you, so what Properties.load reads back is exactly what you put in.

Instant Private Zero cookies

YAML input

Properties output

What this tool does

Nesting becomes dots, lists become indices:

db:
  host: db.example.com
  port: 5432
hosts:
  - a
  - b
db.host=db.example.com
db.port=5432
hosts[0]=a
hosts[1]=b

The [i] form is the Spring convention, and the one most readers expect.

The escaping is the whole job

A .properties file is deceptively simple, and three of its rules quietly eat data.

A value that starts with a space. Properties.load skips the whitespace after the separator, so key= x reads back as x. The first space is escaped — key=\ x — and the value survives. Trailing spaces are kept as they are.

A key that starts with # or !. That line is a comment. The whole entry, key and value, vanishes on reading. Those two characters are escaped when they lead a key.

=, : and spaces inside a key are escaped too, and so is every backslash. A newline in a value becomes \n, a tab \t.

Two keys that flatten to the same name

"a.b": 1
a:
  b: 2

Both give a.b. The format cannot distinguish them, and Properties.load keeps the last — so one of your two values would be gone, with nothing to say so.

The conversion stops and names the key. It is the only case here where the tool refuses rather than converts, and it is the case where converting would lie.

There are no types

Everything in a .properties file is text. true comes back as "true", 42 as "42", and a null as an empty value. Your reader decides what any of it means — Boolean.parseBoolean, Integer.parseInt, and a decision about what empty means.

A word on encoding

The output is UTF-8 text, accented characters and all. That is what modern Java reads, and what Properties.load(Reader) has always read.

But Properties.load(InputStream) — the older, more common call — reads ISO-8859-1, and will turn café into mojibake. If your reader is that one, either switch it to the Reader overload or escape the non-ASCII characters as \uXXXX before shipping the file.

Private by design

Everything runs locally in your browser with JavaScript. Your data is never uploaded, which makes the tool safe for sensitive content, and it keeps working offline.

Frequently asked questions

Why was my key rejected as a duplicate?
Because two different paths flattened to the same name. A literal key `a.b` and a nested `a:` with a `b:` under it both give `a.b`, and a .properties file cannot tell them apart — `Properties.load` keeps the last and the other value disappears. Rather than choose for you, the conversion stops and names the collision.
What happens to a value that starts with a space?
The space is escaped as `\ `. Java skips the whitespace that follows the separator, so `key= x` reads back as `x` — the leading spaces silently gone. Escaping the first one keeps the value intact; the following ones and any trailing ones need nothing.
Does the file keep my types?
No, and no .properties file can. Everything is text: `true`, `42` and `null` come back as the strings `"true"`, `"42"` and `""`. Your reader decides what they mean. That is the format, not a limitation of this conversion.

Related converters