Properties JSON Converter
BetaConvert Java .properties to nested or flat JSON, or flatten JSON back to dotted keys, in your browser. Continuations, \uXXXX escapes, and # or ! comments handled.
- Free, no sign-up
- Updated
- Reviewed by Olgun Ozoktas
The properties text is converted in your browser and is not uploaded to FindUtils. Analytics and ads may load on the page.
The JSON will appear here..
How to convert .properties to JSON
-
Paste or upload the file
Paste the properties text into the left panel or upload the .properties file. The samples are a Spring Boot application.properties, a gradle.properties and a log4j.properties. -
Pick Nested or Flat
Nested expands app.db.host into {"app":{"db":{"host":...}}} and features[0], features[1] into an array. Flat keeps each dotted key as one JSON key, which is the safer choice when keys are read back by name. -
Decide on types
Values stay strings by default, the way Properties.getProperty returns them. Turn on Numbers and booleans to promote 8080 and true when a schema expects them. -
Copy or download
Copy the JSON or download converted.json. Switch the direction to flatten JSON back to .properties; the current output moves into the input for a round-trip check.
Common Use Cases
Migration review
Feeding a JSON-only tool
Generating .properties from JSON
Finding duplicate keys
Why convert .properties to JSON in the browser?
The .properties format is older than JSON and has rules that surprise people who treat it as KEY=value: continuation lines joined by a trailing backslash, keys that end at a colon or a space as well as an equals sign, comments that start with an exclamation mark, and \uXXXX escapes that exist because the default loader reads bytes as ISO-8859-1. FindUtils' Properties JSON Converter implements java.util.Properties.load in the browser and turns the result into JSON, so the output matches what a Java program would see.
Nested mode is what most people want for reading: dotted keys become a tree and [n] suffixes become arrays, with a warning when a key is both a value and a prefix. Flat mode keeps the dotted keys as they are, which is the right shape when another program reads the keys back by their full names. Values stay strings unless you ask for numbers and booleans, because getProperty returns strings and a zero-padded id should stay zero-padded.
The reverse direction flattens nested JSON into dotted keys and arrays into name[0], name[1], and escapes what the loader needs escaped. The page is not a Spring profile merger and does not read application.yml; it converts one file. For dotenv files, use the Env JSON Converter; for YAML and TOML, the JSON YAML Converter and the JSON TOML Converter follow the same layout.
How it compares
Most online properties-to-JSON converters split each line at the first equals sign and stop there, so a continuation line, a colon separator or a \u escape produces a wrong key or value without an error. This page follows the Java loader's rules and reports what it changed: duplicates, malformed escapes and nesting conflicts. It runs in the browser, so a config file that carries connection strings never leaves the tab.
Compared with writing a Java one-liner, the page needs no JDK and shows the nested shape immediately. It is not a substitute for Spring's own binding: relaxed names, profiles and placeholders such as ${port} are left as written.
Properties Conversion Tips
- A line ending in a single backslash continues onto the next line, and that line's leading whitespace is dropped. Two backslashes at the end of a line are a literal backslash, not a continuation.
- Both # and ! open a comment, but only at the start of a line. A # in the middle of a value is part of the value.
- A key can end at =, at :, or at the first unescaped space. app.name Demo is the same as app.name=Demo.
- Nested mode lets the object win when a key is both a value and a prefix, such as a=1 next to a.b=2, and lists the dropped value under Warnings. Flat mode keeps both.
- Leave the \uXXXX escapes on when the file will be read by Properties.load(InputStream), which uses ISO-8859-1. Turn them off for a UTF-8 reader such as Properties.load(Reader) or a Spring config file.