// converters
Properties to YAML.
Convert Java .properties files to clean YAML. Supports unicode escapes, comments, and nested keys. All processing happens in your browser — nothing is uploaded.
Properties input
YAML output
What are .properties files?
Properties files are a key-value format used extensively in Java, Spring Boot, and many other frameworks. Each line contains key = value or key: value pairs. Comments start with # or !. The dot notation in keys (database.host) represents nested structure, which this tool converts to YAML's native hierarchy.
Properties files are flat by design — they don't support nested objects or arrays natively. When you have database.host = db.internal and database.port = 5432, the dots in the key names imply nesting. This tool reconstructs that nesting as proper YAML mappings.
When to convert properties to YAML.
Spring Boot migration. Spring Boot uses application.properties by default but supports application.yml. Convert your existing properties file to YAML for better readability — especially when you have many related properties with common prefixes.
Configuration modernization. Newer tools (Docker Compose, Kubernetes, GitHub Actions) use YAML, not properties. Convert legacy Java properties to YAML when migrating to containerized or cloud-native deployments.
Documentation. YAML is easier to read and annotate with comments. Convert a properties file to YAML to create human-readable documentation of your application's configuration.
Conversion details.
Dot-separated keys are split into nested YAML objects: a.b.c = value becomes a: b: c: value. Comments (# and ! prefixed lines) are stripped. Values are auto-typed: true/false become booleans, numbers become integers or floats, and everything else stays as a string. The tool also handles Unicode escape sequences (\u0041 → A).
Properties format details.
Java properties files support two delimiter styles: key = value and key: value. Both are equivalent. Multi-line values are continued on the next line by ending the current line with a backslash. Values can reference other properties using ${variable.name} syntax, though this tool treats those references as literal strings.
Properties files have no native support for arrays or lists. A common convention is using comma-separated values (feature_flags = new-billing,dark-mode) or indexed keys (servers[0] = host1). The converter preserves these as strings in the YAML output, preserving the original format. This approach works well for most Spring Boot applications that expect properties-style configuration.
Migration best practices.
When converting a large properties file, review the output for keys with many levels of nesting. Very deep dot paths (a.b.c.d.e.f) produce deeply nested YAML that may be harder to read than the original. Consider flattening some sections. Also verify that auto-typed values are correct — a port number like 5432 becomes an integer in YAML, which is usually what you want, but some systems expect string types. Testing the converted output with your target system ensures compatibility.
Handling complex properties.
Some properties files use indexed keys for arrays (servers[0] = host1, servers[1] = host2). The converter detects these patterns and produces a YAML sequence rather than nested mappings. Similarly, multi-line values that use backslash continuation are joined into a single YAML string. If your properties file uses the ${variable} reference syntax, these are preserved as literal strings — resolving them requires the actual properties context at runtime.
FAQ
How do I convert a Java .properties file to YAML?
In Python: `configparser` doesn't handle .properties well, use `jproperties` or `pyjavaproperties`; then `yaml.dump(parsed_dict)` outputs proper YAML with types.
How do I handle nested keys in properties files (dot.notation)?
Spring Boot supports `spring.datasource.url=...` which maps to nested YAML; convert with `spring-config-converter` or a custom script that splits on dots and builds nested dict.
Why does properties-to-YAML conversion lose Unicode characters?
Java .properties files use ISO-8859-1 by default (with `\uXXXX` escapes for Unicode); use `Properties.load(Reader)` with UTF-8 encoding or unescape `\u` sequences in post-processing.
Can I bulk convert many .properties files to YAML?
Loop in shell: `for f in *.properties; do python convert.py "$f" > "${f%.properties}.yaml"; done` — works for hundreds of files with consistent structure.
How do I handle properties file comments when converting to YAML?
Java properties uses `#` or `!` for comments; YAML uses `#` — a converter script can read line-by-line and prepend `#` for non-key-value lines as YAML comments.