How to Convert Java .properties to YAML
Spring Boot accepts configuration as either a flat .properties file or nested YAML. Teams often need to move between them — migrating an old project to application.yml, matching a teammate’s setup, or satisfying a tool that only reads one format.
This guide explains what changes during the conversion and how to do it in your browser without uploading the file.
What changes when .properties becomes YAML
A .properties file is a flat list of key=value lines, with nesting expressed through dots: server.port=8080, spring.datasource.url=…, and so on. YAML expresses the same data with indentation, so those dotted keys are rebuilt into nested blocks.
- server.port=8080 becomes a nested server → port value.
- spring.datasource.url=… becomes spring → datasource → url.
- Array indices such as list[0]=a are rebuilt into YAML sequences.
Comments and edge cases
Comments beginning with # or ! are carried over and attached to the key that follows them. Blank lines and column alignment are not preserved, because YAML does not rely on them.
Values are coerced where it is safe: true/false and null become YAML booleans and null, and numbers are converted only when they round-trip exactly, so leading zeros and large IDs are not corrupted.
Convert .properties to YAML privately
The Properties ↔ YAML tool on this site runs entirely in your browser. Paste the .properties content or load the file, choose the Properties → YAML direction, and copy or download the result. Configuration often contains database passwords and API keys, so nothing is sent to a server.
Try it yourself — free and private
These tools run entirely in your browser. Nothing is uploaded.
Properties to YAML Converter
Convert Java .properties to YAML (and back) — Spring Boot friendly, no upload.
JSON Formatter
Format, validate and beautify JSON in your browser — no upload.
Base64 Encoder / Decoder
Encode text to Base64 or decode it back — UTF-8 safe, no upload.
Frequently Asked Questions
How do I convert a .properties file to YAML?
Paste the .properties content (or load the file), choose the Properties → YAML direction, then copy or download the result. Dotted keys such as server.port are rebuilt into nested YAML.
Are comments preserved when converting properties to YAML?
Yes. # and ! comments are carried over and attached to the key that follows them. Blank lines and alignment are not preserved.
Does this work for Spring Boot application.properties?
Yes. application.properties converts directly to application.yml, and converting back produces a flat .properties file again.