Properties ↔ JSON Converter
Convert between Java .properties files and JSON with dot-notation expansion, Unicode escapes, and comment preservation.
About This Tool
The Properties to JSON Converter is a free browser-based tool
that transforms Java .properties files into JSON and vice
versa. The .properties format is widely used across the Java
ecosystem for configuration files, including Spring Boot
application.properties, Gradle gradle.properties,
Log4j configurations, and internationalization (i18n) resource
bundles. This tool makes it easy to convert between the two
formats for migration, debugging, or integration with modern
JSON-based tooling.
The parser handles all standard .properties syntax: key-value
pairs separated by =, :, or whitespace; multi-line values
using backslash continuation; Unicode escapes (\uXXXX); and
comment lines starting with # or !. When converting to
JSON, dot-separated keys like app.db.host can be
automatically expanded into nested objects
({"app":{"db":{"host":"..."}}}), or kept as flat keys
depending on your preference. Values that look like numbers
or booleans are automatically typed in the JSON output.
Going in the reverse direction, from JSON to .properties,
nested objects are flattened back into dot-notation keys and
all values are serialized as strings with proper escaping.
This is useful when you need to convert a JSON configuration
file (such as a Node.js config or a Docker environment export)
into a format that Java applications can consume.
If you work with YAML configuration files, try the JSON ↔ YAML converter or the YAML ↔ ENV converter. For TOML config files (Cargo.toml, pyproject.toml), check out the TOML ↔ JSON converter.
All processing happens entirely in your browser. Your configuration data never leaves your machine — there are no server round-trips, no logging, and no third-party services involved. This makes it safe to use with production credentials, database connection strings, and other sensitive configuration values.
How to Use
- Select the conversion direction using the Properties → JSON / JSON → Properties toggle button.
- Paste your
.propertiescontent or JSON into the input panel on the left. - The converted output appears automatically in the right panel as you type.
- For Properties → JSON: toggle Nested to expand dot-notation keys into nested objects, or switch to Flat to keep them as-is.
- Toggle Comments to include
#and!comment lines in the JSON output as a_commentsarray. - Click the indent button to switch between 2 spaces and 4 spaces indentation.
- Click Copy or press Ctrl+Shift+C to copy the output to your clipboard. Use the preset buttons (Spring, Gradle, Log4j) to load sample data.
Popular Properties Conversion Examples
FAQ
What .properties syntax is supported?
The parser supports all standard Java .properties syntax: key=value pairs (with =, :, or whitespace separators), multi-line values using backslash (\) continuation at end of line, Unicode escapes (\uXXXX), comment lines starting with # or !, and escaped special characters (\=, \:, \#, \!, \\, \n, \t, \r).
How does dot-notation expansion work?
When the Nested option is enabled, keys containing dots are split and expanded into nested JSON objects. For example, 'app.db.host=localhost' becomes {"app":{"db":{"host":"localhost"}}}. When set to Flat, the key is kept as-is: {"app.db.host":"localhost"}. This is especially useful for Spring Boot properties which heavily use dot-notation.
Are values automatically typed in JSON output?
Yes. When converting Properties to JSON with nested mode enabled, the tool attempts to parse values as their natural types: 'true' and 'false' become JSON booleans, numeric strings become JSON numbers, and everything else remains a string. In flat mode, all values are kept as strings.
How are comments handled?
By default, comment lines (starting with # or !) are stripped during conversion. If you enable the Comments option, they are preserved in the JSON output as a '_comments' array at the top level. When converting from JSON to Properties, the '_comments' field is ignored.
Can I convert JSON back to .properties format?
Yes. Toggle the direction to JSON → Properties, paste your JSON, and the tool will flatten nested objects into dot-notation keys and serialize all values as properly escaped property strings. Arrays are represented using bracket notation (e.g., items[0], items[1]).
Is my data safe?
Yes. All parsing and conversion runs entirely in your browser using JavaScript. No data is sent to any server. You can verify this by checking the Network tab in your browser's developer tools while using the tool. This makes it safe for production credentials and sensitive configuration.
What presets are available?
The tool includes three presets: Spring Boot application.properties (with database, JPA, and logging configuration), Gradle gradle.properties (with JVM args, Android settings, and versioning), and Log4j log4j.properties (with console and file appenders). Click any preset button to load the sample data.
Related Tools
JSON ↔ YAML Converter
Convert between JSON and YAML formats instantly with syntax validation.
INI ↔ JSON Converter
Convert between INI configuration files and JSON format with section handling, comment preservation, and type coercion.
TOML ↔ JSON Converter
Convert between TOML and JSON formats instantly. Perfect for Cargo.toml, pyproject.toml, and config files.
JSON Formatter
Format, validate, and beautify JSON with syntax highlighting and tree view.
YAML to ENV Converter
Convert between YAML and .env file formats. Flatten nested YAML keys into environment variable names.