Properties to JSON Converter
Convert Java .properties text into a JSON object. It handles comments, escape sequences, line continuations, and can turn dotted keys into nested objects.
1 Paste your text and pick the options
2 Your answer
Your answer shows here as you type.
How to use the Properties to JSON Converter
- Paste the contents of your .properties file into the box.
- Leave the nesting option on to turn keys like app.port into nested objects, or turn it off to keep keys flat.
- Copy the JSON from the result box.
Frequently asked questions
How are keys and values separated in a .properties file?
A key ends at the first unescaped equals sign, colon, or whitespace. Any whitespace around the separator is ignored, so key=value, key: value and key value all give the same pair.
How are comments written in a .properties file?
A line that starts with # or ! (after optional whitespace) is a comment and is skipped. Blank lines are skipped too.
What does a backslash at the end of a line do?
It continues the entry on the next line. The backslash and the leading whitespace of the next line are removed, so the value is joined without a line break.
What happens if the same key appears twice?
The last value wins, which matches how Java's Properties class loads a file. All values are written as JSON strings.
Wrote something with AI? Slop Monkey rewrites it so it sounds like you, and keeps your facts.