Java properties to JSON converter
Paste application.properties or a message bundle to get JSON. It applies the same rules as Java Properties.load.
Loading the tool…
Processing and privacy: The result is calculated inside your browser and your data is not sent to any server.
How to use it
- Enter properties text, build nested objects from dots, turn numbers and true/false into typed values and indentation.
- The result appears straight away and updates as you edit.
- Copy the result, or copy a link that keeps the same values to share it.
How it is calculated
Lines starting with # or ! are comments, and a line ending in an odd number of \ continues on the next. The key ends at an unescaped =, : or space, and \t, \n and \uXXXX are decoded. With nesting, a.b.c becomes nested objects and list[0] a list; with typing, text becomes a number only if its form stays the same.
Example
Inputs: Build nested objects from dots = yes, Turn numbers and true/false into typed values = yes, Indentation = 2 spaces. Result: JSON: { "server": { "port": 8080 }, "spring": { "application": { "name": "demo" }, "datasource": { "url": "jdbc:mysql://localhost:3306/shop" } }, "app": { "languages": [ "ar", "en" ], "title": "ToolSahla" } }; Keys: 6.
# Spring Boot server.port=8080 spring.application.name=demo spring.datasource.url=jdbc:mysql://localhost:3306/shop app.languages[0]=ar app.languages[1]=en app.title=ToolSahla
{
"server": {
"port": 8080
},
"spring": {
"application": {
"name": "demo"
},
"datasource": {
"url": "jdbc:mysql://localhost:3306/shop"
}
},
"app": {
"languages": [
"ar",
"en"
],
"title": "ToolSahla"
}
}Limits and caveats
- Nesting rejects a key that is both a value and a group, such as a and a.b; turn the option off in that case.
- For a repeated key the last value wins, as in Java.
Questions about this tool
Does \u0645 turn into an Arabic letter?
Yes. Every \uXXXX is decoded to its character, so Arabic text is readable in the JSON.
Why do I get a key clash error?
The file sets a as a value and a.b under it, which JSON cannot hold together. Turn nesting off for flat JSON.
Does it accept a key and value separated only by a space?
Yes. As in Java, =, : or whitespace all work as the separator.
