What is JSON to Properties Converter?
JSON (JavaScript Object Notation) is a widely used data format for structured configuration, while Java .properties files store configuration as key=value pairs using dot notation for nested keys. This tool converts between the two formats: flatten nested JSON objects into .properties files with dot notation keys, or reconstruct nested JSON from .properties files. It handles nested objects using dot notation and arrays using index notation.
How to Use
- Choose the conversion direction using the toggle button (JSON → Properties or Properties → JSON)
- Paste your JSON or .properties content in the input area
- Click 'Convert' to generate the output
- In Properties → 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 → 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.
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 → 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.