Properties to JSON Converter
Turn a Java .properties file into nested JSON. Escapes, comments and continued lines are handled.
How to convert a properties file to JSON
Paste your properties file
Paste or type it into the box, or press Try an example.
Nest the keys
Turn dotted keys like server.port into nested objects, or keep them flat.
Convert values
Tick the box to turn numbers and true or false into real JSON values.
Copy or download
Use the JSON in your code.
Worked example
This is what Properties to JSON Converter gives for its own sample values. Open the tool above and change anything to try your own.
Properties
# server server.port=8080 server.host=localhost app.name=Sarva app.debug=true
- Indentation
- 2 spaces
- Nest dotted keys into objects
- Yes
- Convert numbers and true/false
- Yes
JSON
{
"server": {
"port": 8080,
"host": "localhost"
},
"app": {
"name": "Sarva",
"debug": true
}
}About Properties to JSON Converter
Turn a Java .properties file into JSON, with dotted keys nested into objects. Comments, = and : separators, escapes and lines continued with a backslash are all handled.
FAQs
Can I keep the keys flat?
Yes. Turn off nesting to keep keys such as server.port as they are.
Are numbers converted?
Yes, by default. Turn the option off to keep everything as text.
Can I go the other way?
Use JSON to Properties Converter.