Java .properties to JSON Converter

Convert Java .properties files to JSON following Properties.load rules: comments, = : and space separators, line continuations, \uXXXX escapes, nesting. Free.

Runs entirely in your browser. Your data is never uploaded.

Related Tools

View All

What is Properties to JSON?

Paste a Java .properties file – for example Spring Boot's application.properties or a message bundle – and get JSON. Keys can stay flat ("app.name") or be nested into objects by their dots.

How to use Properties to JSON

  1. Paste .properties into the .properties input box, or use Load sample or Open file.
  2. Toggle Nest dotted keys into objects and choose the JSON Indentation.
  3. The JSON output updates as you type; use Copy or Download.

Example

Input
app.name = My App
app.port: 8080
Output
{
  "app.name": "My App",
  "app.port": "8080"
}

When to use Properties to JSON

Use it to inspect, migrate or diff Java configuration and i18n bundles. It does not resolve Spring placeholders such as ${server.port} or profile-specific files.

How Properties to JSON works

The parser follows java.util.Properties.load: lines starting with # or ! are comments, a line ending with an odd number of backslashes continues on the next line (leading whitespace removed), and the key ends at the first unescaped =, : or whitespace. Escapes \t, \n, \r, \f and \uXXXX are decoded; any other escaped character stands for itself. Later duplicates win. When nesting, a key that would collide with an existing value (e.g. a=1 and a.b=2) is kept flat so nothing is lost. All values are strings, as in Java.

Common Use Cases

  • Convert application.properties to JSON or YAML-ready structure
  • Turn a Java message bundle into JSON for a JavaScript i18n library
  • Compare two property files as JSON
  • Decode \u escapes in old ISO-8859-1 bundles

FAQs

Are numbers converted?

No. Java properties are always strings, so values stay strings like "8080".

How are line continuations handled?

A trailing backslash joins the next line, and that line's leading spaces are removed, exactly like Java does.

What happens when nesting conflicts?

If both a and a.b exist, a.b stays as a flat key instead of overwriting a.

Good next steps

Explore more categories