.properties to JSON

Paste .properties and get JSON at once, with errors pointed by line and column, then copy or download the result.

loading .properties to JSON
About this tool

What are .properties and JSON?

A .properties file is the Java configuration format: key=value lines whose dotted keys (spring.datasource.url) imply a hierarchy, with \uXXXX escapes for non-ASCII text. JSON is the text format of web APIs: objects in braces, lists in brackets, strings always in double quotes, and nothing else.

Useful to inspect a Java configuration as a tree, to feed it to a JavaScript tool, or to turn a Java i18n bundle into the JSON that front-end libraries read.

This page opens the data converter already set to .properties → JSON. Paste the text, read the result as you type, then copy it or download it as a file. Errors show the line and the column. Nothing is sent anywhere: the conversion runs in your browser.

.properties vs JSON

.propertiesJSON
Extension.properties.json
Media typetext/x-java-propertiesapplication/json
Commentsyes (# or !)no
Data typestext onlystring, number, true/false, null, object, array
Nestingimplied by dotted keys and [0]any depth
Typical useSpring Boot, Java apps, i18n bundlesAPIs, package.json, logs
Specificationjava.util.PropertiesRFC 8259

When to convert .properties to JSON

  • Convert to JSON when another program or an API will read the data.
  • Keep .properties when a Spring Boot or Java app reads its settings from it.

What changes in the conversion

  • Comments of the .properties file are not carried over: the converter reads the data, and comments are not data.
  • Dotted keys become nested objects and [0] becomes a list; every value is text, because .properties has no types.

How to convert .properties to JSON

  1. Paste your .properties in the input box (the page opens with an example you can replace).
  2. Read the JSON on the right; it updates as you type. If something is wrong, the message says the line and column.
  3. Adjust the options if you need: indentation, sorted keys or type detection.
  4. Copy the result or download it as a .json file.

Example

This .properties input:

# orders service
spring.application.name=orders
server.port=8080
spring.datasource.url=jdbc:postgresql://db:5432/orders
spring.datasource.hikari.maximum-pool-size=10
app.features[0]=pix
app.features[1]=boleto

becomes this JSON, exactly as the converter writes it:

{
  "spring": {
    "application": {
      "name": "orders"
    },
    "datasource": {
      "url": "jdbc:postgresql://db:5432/orders",
      "hikari": {
        "maximum-pool-size": "10"
      }
    }
  },
  "server": {
    "port": "8080"
  },
  "app": {
    "features": [
      "pix",
      "boleto"
    ]
  }
}

Frequently asked questions

Is my .properties sent to a server?

No. Conversion happens in your browser, so secrets in a config never leave your computer.

Does .properties to JSON keep comments?

No. Comments are dropped because the converter works on the data itself. Copy important comments by hand; JSON itself has no comment syntax.

What happens to nested data?

.properties nesting: implied by dotted keys and [0]. JSON nesting: any depth. The structure is kept as it is.

Report a problem