Convert Properties to JSON
Convert Java properties file format to JSON with support for nested objects, arrays, and custom separators.
Input (Properties File)
Options
Output (JSON)
What It Does
Convert Java .properties files to JSON format instantly with this free online tool. The .properties format is a widely used configuration standard in Java applications, Spring Boot projects, and many JVM-based frameworks — but its flat, line-based structure can be limiting when you need to work with modern APIs, JavaScript applications, or tools that expect structured JSON data. This converter intelligently parses your properties content, including dot-notation keys like `server.port=8080`, and transforms them into properly nested JSON objects. Type inference automatically detects numbers, booleans, and strings so your output JSON reflects the correct data types rather than wrapping everything in quotes. Whether you're migrating a legacy Spring application to a Node.js backend, feeding configuration data into a CI/CD pipeline, or simply need to inspect your config in a more readable hierarchical format, this tool handles the heavy lifting in seconds. No installation, no dependencies, no sign-up required — just paste your properties content and get clean, valid JSON output ready to copy, use, or integrate into your workflow.
How It Works
The Convert Properties to JSON applies its selected transformation logic to your input and produces output based on the options you choose.
It applies a fixed set of transformation rules to your input, so the output is stable and easy to verify.
All processing happens in your browser, so your input stays on your device during the transformation.
Common Use Cases
- Migrating a Spring Boot or Java EE application's configuration files to a Node.js or Python service that consumes JSON config.
- Converting application.properties or application.yml-adjacent files into JSON for use with configuration management tools like Consul or etcd.
- Transforming flat .properties-based i18n locale files into nested JSON objects compatible with JavaScript internationalization libraries like i18next.
- Quickly inspecting and debugging complex Java configuration files by viewing them as a hierarchical JSON tree instead of a flat list of key-value pairs.
- Generating JSON fixtures or test data from existing properties files when writing integration tests for multi-language systems.
- Feeding configuration values from a .properties file into a REST API or JSON-based pipeline without manual reformatting.
- Onboarding new developers who are unfamiliar with the .properties format by converting it to the more universally understood JSON structure for documentation purposes.
How to Use
- Paste your entire .properties file content into the input area on the left — this can include comments (lines starting with # or !), blank lines, and keys using dot notation like `database.host=localhost`.
- The tool immediately parses your input and renders the equivalent JSON structure in the output panel on the right, grouping dot-notated keys into nested objects automatically.
- Review the output JSON to confirm that nested objects, arrays, and data types (numbers, booleans, strings) have been correctly inferred from your property values.
- Use the Copy button to copy the formatted JSON to your clipboard, or download it directly as a .json file for use in your project.
- If you see unexpected output, double-check your .properties file for duplicate keys or non-standard syntax, then re-paste the corrected content for an updated result.
Features
- Dot notation parsing that converts keys like `app.server.port=8080` into fully nested JSON objects: `{ "app": { "server": { "port": 8080 } } }`.
- Automatic type inference that detects integers, floats, booleans (`true`/`false`), and null values so the output JSON uses the correct types rather than plain strings.
- Comment stripping that cleanly removes lines beginning with `#` or `!` from the output without disrupting surrounding key-value pairs.
- Support for multi-line values using the backslash line-continuation character common in Java .properties files.
- Handles both `=` and `:` as key-value delimiters, covering the full range of valid .properties syntax as defined by the Java specification.
- Instant, client-side conversion with no server upload required — your configuration data never leaves your browser, keeping sensitive credentials and settings private.
- Formatted JSON output with proper indentation for maximum readability, ready to drop directly into a codebase or configuration system.
Examples
Below is a representative input and output so you can see the transformation clearly.
name=Ada score=9
{
"name": "Ada",
"score": "9"
}Edge Cases
- Very large inputs may take a few seconds to process in the browser. If performance slows, split the input into smaller batches.
- Mixed formatting (tabs, line breaks, or inconsistent delimiters) can affect output. Normalize spacing first if needed.
- Convert Properties to JSON follows the selected options strictly. If the output looks unexpected, re-check option settings and input format.
Troubleshooting
- Output looks unchanged: confirm the input contains the pattern this tool modifies and that the correct options are selected.
- Output differs from a previous run: confirm that the input and every option match, because deterministic tools should repeat when the settings are identical.
- Unexpected characters: check for hidden whitespace or encoding issues in the input and try normalizing first.
- Slow processing: reduce input size or try a modern browser with more available memory.
Tips
When converting properties files that contain sensitive data like database passwords or API keys, this tool processes everything locally in your browser — nothing is sent to a server, so your secrets stay private. For large configuration files with deeply nested dot keys, scan the JSON output tree to verify the hierarchy matches your intent, especially if any keys share a prefix segment (e.g., `server.name` and `server.name.full` can cause structural conflicts). If your .properties file uses Unicode escape sequences (e.g., `\u0041`), make sure they are properly decoded before converting, as some editors may store them literally. Always validate your output JSON with a JSON linter before dropping it into a production configuration to catch any edge cases introduced during conversion.
Frequently Asked Questions
What is a .properties file and when is it used?
A .properties file is a plain-text configuration format used primarily in Java applications to store key-value pairs outside of compiled code. It's defined by the `java.util.Properties` class in the Java standard library. Common uses include externalizing database URLs, server ports, feature flags, and internationalization strings in frameworks like Spring Boot, Hibernate, and Apache Ant. Each line follows the format `key=value` or `key: value`, with `#` and `!` used for comments.
How does dot notation in .properties files get converted to nested JSON?
Dot notation in .properties keys — such as `app.server.host=localhost` — implies a hierarchical relationship between configuration values. When converting to JSON, each dot-separated segment becomes a level in a nested object. So `app.server.host=localhost` and `app.server.port=8080` together become `{ "app": { "server": { "host": "localhost", "port": 8080 } } }`. This conversion makes the implied structure explicit and consumable by any JSON parser, regardless of programming language.
Will the converter handle type inference, or will all values become strings?
This tool performs automatic type inference on property values. Numeric values like `8080` or `3.14` are output as JSON numbers, boolean-like values (`true`, `false`) become JSON booleans, and everything else is treated as a string. This means your output JSON is semantically correct and ready to use without additional post-processing to cast types. Always review the inferred types for critical values like ports, timeouts, or flags to confirm they match your expectations.
Is it safe to paste sensitive configuration data like passwords or API keys?
Yes. This tool runs entirely client-side in your browser using JavaScript. Your .properties content is never transmitted to any external server — all parsing and conversion happens locally on your machine. That said, it's still good practice to avoid pasting production credentials into any web-based tool when a local alternative exists. For highly sensitive environments, consider running an equivalent command-line conversion script locally.
What happens if I have duplicate keys in my .properties file?
In the Java .properties specification, duplicate keys are technically allowed, with the last occurrence taking precedence. Most converters, including this one, follow the same convention and use the last defined value for any repeated key. If your file contains duplicate keys, review the JSON output carefully to confirm the retained value is the correct one. Duplicate keys in .properties files are often the result of configuration drift and can silently mask intended settings.
What's the difference between converting .properties to JSON vs. converting .properties to YAML?
Both JSON and YAML can represent the same nested configuration hierarchy derived from dot-notated .properties keys, but they serve different audiences. JSON is stricter, universally supported across all programming languages, and ideal for APIs, JavaScript applications, and machine-to-machine communication. YAML is more human-readable, supports comments (which JSON does not), and is popular for Kubernetes manifests, Docker Compose files, and Spring Boot's `application.yml`. If your target system is a JavaScript app or REST service, JSON is the better choice; if you're writing infrastructure-as-code or staying within the Spring ecosystem, YAML is often preferred.