What is JSON to Properties Converter?
Java .properties files are a simple key-value configuration format that has been a staple of the Java ecosystem since the early days. They store configuration as flat key=value pairs, using dot notation to represent hierarchical structure — for example, server.port=8080 represents the nested object {"server": {"port": 8080}}. This tool converts bidirectionally between JSON and .properties format. When flattening JSON to properties, nested objects are expanded into dot-separated keys and arrays use index notation (items.0, items.1). When reconstructing JSON from properties, dot notation keys can be expanded back into nested objects or kept as flat keys. Special characters like equals signs, colons, and hash symbols are properly escaped to produce valid .properties files that Java's Properties class can read without errors.
How to Use
- Choose the conversion direction using the toggle button (JSON to Properties or Properties to JSON)
- Paste your JSON or .properties content in the input area
- Click 'Convert' to generate the output
- In Properties to JSON mode, choose Nested mode to expand dots into objects or Flat mode to keep keys as-is
- Copy the result and use it in your project
Why Use This Tool?
Tips & Best Practices
- Nested keys use dot notation: {"server": {"port": 8080}} becomes server.port=8080
- Arrays use index notation: {"servers": ["host1"]} becomes servers.0=host1
- Special characters in values are escaped: = becomes \=, newlines become \n
- Comments starting with # are preserved in Properties to JSON mode (skipped during parsing)
- Use Nested mode to reconstruct object hierarchies from dot notation keys
Frequently Asked Questions
How are nested JSON objects handled?
Nested objects are flattened using dot notation. For example, {"server": {"port": 8080}} becomes server.port=8080. This follows the standard Java Properties convention used in Spring Boot and other frameworks.
When should I not use this converter?
Avoid this tool when your configuration requires preserving complex nested structures with mixed types — .properties files can only represent flat string key-value pairs, so type information (numbers, booleans) is lost during the JSON-to-properties conversion. Also avoid it for binary data or very large files, since the entire content is processed in memory.
How are arrays converted?
Arrays use index notation. For example, {"servers": ["host1", "host2"]} becomes servers.0=host1 and servers.1=host2. If array items are objects, they are further flattened with the index as part of the key prefix.
Can I convert .properties back to JSON?
Yes. Use the direction toggle to switch to 'Properties to JSON' mode. The tool will parse key=value pairs and expand dot notation into nested objects. You can choose between Nested mode (expands dots into objects) or Flat mode (keeps keys as-is). Boolean, number, and null values are automatically detected.
How are special characters escaped?
In Properties output, special characters like =, :, #, !, and newlines are properly escaped using backslash notation (e.g., \=, \:, \n). This ensures the .properties file is valid and can be read by Java's Properties class.
Is my data secure?
Yes. All processing happens entirely in your browser. Your JSON and .properties content is never sent to any server. No data is collected, stored, or transmitted. You can safely convert configs containing sensitive values like database passwords and API keys.
Real-world Examples
Converting Spring Boot application.yml to .properties format
Spring Boot supports both YAML and .properties configuration. When migrating from YAML to properties, paste the JSON representation of your config to get properly flattened .properties output with dot notation keys and escaped special characters.
{
"server": {
"port": 8080,
"ssl": {
"enabled": true
}
},
"spring": {
"datasource": {
"url": "jdbc:postgresql://localhost:5432/mydb",
"username": "admin"
}
}
}server.port=8080 server.ssl.enabled=true spring.datasource.url=jdbc\:postgresql\://localhost\:5432/mydb spring.datasource.username=admin
Parsing existing .properties files into structured JSON
When you need to programmatically inspect or transform a .properties file, convert it to JSON first. The Nested mode reconstructs the hierarchical structure from dot notation, making it easy to merge, diff, or template configurations.
logging.level.root=info logging.level.org.springframework=debug management.endpoints.web.exposure.include=health,info
{
"logging": {
"level": {
"root": "info",
"org.springframework": "debug"
}
},
"management": {
"endpoints": {
"web": {
"exposure": {
"include": "health,info"
}
}
}
}
}