Convert Properties Files to JSON Convert Java .properties files to structured JSON with nested key support.
Properties to JSON
Convert Java .properties files to structured JSON with nested key support.
Paste .properties content
Paste your Java properties file content.
View JSON
Dotted keys become nested JSON objects automatically.
Copy JSON
Copy the structured JSON output.
What Is Properties to JSON?
A Properties to JSON is a file-conversion tool that transforms Java-style .properties files into structured JSON format, making it easier to work with configuration data in JavaScript environments. Developers working on projects that involve Java application configuration, i18n message bundles, and Spring Boot settings use this type of converter to simplify their workflow, specifically when dealing with the problem of parsing complex properties files with nested structures. For instance, when a properties file contains dotted keys like db.host=localhost, it can be challenging to parse and convert them into a usable JSON format.
The tool solves this specific problem by supporting dotted keys, which are expanded into nested JSON objects, allowing for easier data access and manipulation. It also handles # and ! comment styles, escape sequences (\n, \t), and both = and : separators, making it a reliable choice for converting properties files to JSON. What makes Properties to JSON different is its ability to unescape common Java properties escapes, such as \\n and \\t, and build nested structures from dotted keys, resulting in a clean and organized JSON output.
It uses the `JSON.stringify` method with an indentation of 2 spaces to format the output, making it more readable and easier to work with. As a java properties converter, it can be used to convert properties files to json, and its support for properties file parser functionality allows it to handle complex configuration files with ease, ultimately helping developers to easily convert .properties to JSON and integrate them into their projects.
Why Use Properties to JSON?
-
Dotted keys automatically expanded into nested JSON objects.
-
Supports both = and : key-value separators.
-
Handles Java escape sequences (\n, \t, \\).
-
Supports # and ! comment styles.
Common Use Cases
Spring Boot Migration
Convert application.properties to JSON for use with other frameworks.
i18n Processing
Transform Java message bundle .properties files into JSON for JavaScript i18n libraries.
Configuration Analysis
Convert properties files to JSON for programmatic processing and analysis.
DevOps
Parse application configuration into JSON for infrastructure automation.
Technical Guide
The parser processes the properties file line by line. Lines starting with # or ! are treated as comments and skipped. Empty lines are ignored.
Key-value separation supports both = and : delimiters. The parser finds the first occurrence of either delimiter and splits the line there. Both key and value are trimmed of whitespace.
Dotted key expansion: keys containing periods (e.g., db.connection.host) are split and create nested JSON objects. The parser walks the key parts, creating intermediate objects as needed, and sets the value at the deepest level.
Escape sequences are processed: \n becomes newline, \t becomes tab, \\ becomes backslash. This matches Java's standard escape handling.
Tips & Best Practices
-
1Dotted keys (a.b.c) create nested JSON: {"a":{"b":{"c":"value"}}}.
-
2Both = and : separators are supported for key-value pairs.
-
3Comments with # or ! are ignored during parsing.
-
4Java escape sequences (\n, \t) are properly unescaped.
Related Tools
YAML to JSON
Convert YAML to formatted JSON with configurable indentation.
🔄 File Conversion
TOML to JSON
Parse TOML configuration files and convert to JSON format.
🔄 File Conversion
INI to JSON
Parse INI configuration files and convert to structured JSON format.
🔄 File Conversion
JSON to Properties
Convert JSON objects to Java .properties format with dotted key notation.
🔄 File ConversionFrequently Asked Questions
Q How are dotted keys handled?
Q Which separators are supported?
Q Are escape sequences processed?
Q What about multi-line values?
Q Are Unicode escapes handled?
About This Tool
Properties to JSON 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.