JSON to Properties Converter Convert JSON objects to Java .properties format with dotted key notation.
JSON to Properties
Convert JSON objects to Java .properties format with dotted key notation.
Paste JSON
Paste a JSON object into the input field.
View .properties output
Nested objects are flattened to dotted key notation.
Copy result
Copy the .properties output for your Java application.
What Is JSON to Properties?
A JSON to Properties converter transforms JavaScript Object Notation into the Java-style .properties file format, which relies on a simple key=value syntax with dotted keys to represent hierarchical structures, such as db.connection.host=localhost. Developers working with Spring Boot applications or internationalization message bundles often use this type of conversion to integrate their configuration data seamlessly. One specific problem it solves is handling nested JSON objects and arrays in a way that can be easily read by Java properties files.
The tool achieves this by implementing a recursive function, flatten, which takes an object as input and returns a list of key-value pairs with properly formatted dotted keys. For instance, when given the input {"db":{"host":"localhost","port":5432}}, it will output db.host=localhost and db.port=5432. This converter also correctly handles arrays by using indexed keys, such as converting ["value1", "value2"] to an array of key-value pairs with indexes in their keys.
What makes this tool different is its ability to escape special characters like backslashes, newline characters, and tabs, ensuring the output properties file can be used directly in Java applications without requiring additional processing. This feature allows for smooth conversion from JSON data into a format compatible with Java's .properties files or json to java properties conversion requirements. It supports convert json to properties operations by correctly handling nested objects and arrays while preserving their original structure through dotted keys, making it suitable as a json properties converter.
Why Use JSON to Properties?
-
Nested objects flattened to dotted key notation automatically.
-
Arrays converted to indexed keys (array[0], array[1]).
-
Special characters properly escaped for .properties format.
-
Clean output ready for Java and Spring Boot applications.
Common Use Cases
Spring Boot Config
Generate application.properties from JSON configuration data.
Java i18n
Create Java message bundle .properties files from JSON translation data.
Legacy Integration
Convert JSON config to .properties for legacy Java applications.
Build Configuration
Generate .properties files for Maven, Gradle, or Ant build systems.
Technical Guide
The converter recursively traverses the JSON structure, building dotted key paths. For each primitive value encountered, a key=value line is output using the accumulated path.
Nested objects add their key to the path with a dot separator. Arrays use bracket notation with zero-based indices (e.g., items[0]=value). This recursive approach handles JSON of any depth.
Values are escaped for the .properties format: backslashes are doubled, newlines become \n, and tabs become \t. This ensures the output can be parsed correctly by Java's Properties class.
The output uses = as the key-value separator and outputs one property per line, matching standard Java .properties format.
Tips & Best Practices
-
1Nested JSON objects produce dotted keys: {"a":{"b":"c"}} โ a.b=c.
-
2Arrays use indexed notation: [0], [1], etc.
-
3Newlines and tabs in values are escaped with backslash notation.
-
4The output is compatible with Java Properties, Spring Boot, and similar frameworks.
Related Tools
JSON to YAML
Convert JSON to clean, readable YAML format using the js-yaml library.
๐ File Conversion
JSON to TOML
Convert JSON objects to TOML configuration format with tables and array tables.
๐ File Conversion
Properties to JSON
Convert Java .properties files to structured JSON with nested key support.
๐ File Conversion
JSON to INI
Convert JSON objects to INI configuration file format with sections.
๐ File ConversionFrequently Asked Questions
Q How are nested objects handled?
Q How are arrays handled?
Q Are special characters escaped?
Q Can I convert back?
Q Is the output compatible with Java?
About This Tool
JSON to Properties is a free online tool by FreeToolkit.ai. All processing happens directly in your browser โ your data never leaves your device. No registration or installation required.