Skip to content

Developers

Properties JSON Converter

Properties JSON Converter

Beta

Convert Java .properties to nested or flat JSON, or flatten JSON back to dotted keys, in your browser. Continuations, \uXXXX escapes, and # or ! comments handled.

  • Free, no sign-up
  • Updated
  • Reviewed by Olgun Ozoktas

The properties text is converted in your browser and is not uploaded to FindUtils. Analytics and ads may load on the page.

.properties
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
JSON

The JSON will appear here..

How to convert .properties to JSON

  1. Paste or upload the file

    Paste the properties text into the left panel or upload the .properties file. The samples are a Spring Boot application.properties, a gradle.properties and a log4j.properties.
  2. Pick Nested or Flat

    Nested expands app.db.host into {"app":{"db":{"host":...}}} and features[0], features[1] into an array. Flat keeps each dotted key as one JSON key, which is the safer choice when keys are read back by name.
  3. Decide on types

    Values stay strings by default, the way Properties.getProperty returns them. Turn on Numbers and booleans to promote 8080 and true when a schema expects them.
  4. Copy or download

    Copy the JSON or download converted.json. Switch the direction to flatten JSON back to .properties; the current output moves into the input for a round-trip check.

Common Use Cases

Migration review

See a Spring application.properties as one nested object to compare it against an application.yml or a Kubernetes ConfigMap before switching formats.

Feeding a JSON-only tool

Schema checkers, diff viewers and dashboards read JSON. Convert the properties once instead of writing a parser for the escape rules.

Generating .properties from JSON

A build script or a settings screen produces JSON; the converter writes the dotted keys a Java loader expects, with the right escapes.

Finding duplicate keys

Properties.load keeps the last value silently. The duplicate report names the key and every line it appears on.

Why convert .properties to JSON in the browser?

Spring Boot, Gradle, Log4j and a long tail of Java tools keep configuration in .properties files: one dotted key per line, with continuation lines, backslash escapes and two comment characters. Reviewing a migration, feeding a config to a tool that only reads JSON, or checking what a hundred dotted keys actually describe is easier as a nested object. This page reads the file the way java.util.Properties does and writes JSON, nested by default or flat on request, in the tab. The reverse direction flattens a JSON object back into dotted keys and writes non-ASCII text as \uXXXX so an ISO-8859-1 loader reads it correctly.

The .properties format is older than JSON and has rules that surprise people who treat it as KEY=value: continuation lines joined by a trailing backslash, keys that end at a colon or a space as well as an equals sign, comments that start with an exclamation mark, and \uXXXX escapes that exist because the default loader reads bytes as ISO-8859-1. FindUtils' Properties JSON Converter implements java.util.Properties.load in the browser and turns the result into JSON, so the output matches what a Java program would see.

Nested mode is what most people want for reading: dotted keys become a tree and [n] suffixes become arrays, with a warning when a key is both a value and a prefix. Flat mode keeps the dotted keys as they are, which is the right shape when another program reads the keys back by their full names. Values stay strings unless you ask for numbers and booleans, because getProperty returns strings and a zero-padded id should stay zero-padded.

The reverse direction flattens nested JSON into dotted keys and arrays into name[0], name[1], and escapes what the loader needs escaped. The page is not a Spring profile merger and does not read application.yml; it converts one file. For dotenv files, use the Env JSON Converter; for YAML and TOML, the JSON YAML Converter and the JSON TOML Converter follow the same layout.

How it compares

Most online properties-to-JSON converters split each line at the first equals sign and stop there, so a continuation line, a colon separator or a \u escape produces a wrong key or value without an error. This page follows the Java loader's rules and reports what it changed: duplicates, malformed escapes and nesting conflicts. It runs in the browser, so a config file that carries connection strings never leaves the tab.

Compared with writing a Java one-liner, the page needs no JDK and shows the nested shape immediately. It is not a substitute for Spring's own binding: relaxed names, profiles and placeholders such as ${port} are left as written.

Properties Conversion Tips

  • A line ending in a single backslash continues onto the next line, and that line's leading whitespace is dropped. Two backslashes at the end of a line are a literal backslash, not a continuation.
  • Both # and ! open a comment, but only at the start of a line. A # in the middle of a value is part of the value.
  • A key can end at =, at :, or at the first unescaped space. app.name Demo is the same as app.name=Demo.
  • Nested mode lets the object win when a key is both a value and a prefix, such as a=1 next to a.b=2, and lists the dropped value under Warnings. Flat mode keeps both.
  • Leave the \uXXXX escapes on when the file will be read by Properties.load(InputStream), which uses ISO-8859-1. Turn them off for a UTF-8 reader such as Properties.load(Reader) or a Spring config file.

Frequently Asked Questions

What does Nested mode do with app.db.host?

It expands the dotted key into nested objects: {"app":{"db":{"host":"..."}}}. Keys with [0], [1] suffixes become arrays. Flat mode keeps app.db.host as a single JSON key.

Why are numbers quoted in the JSON?

Because Properties.getProperty returns a string, so server.port=8080 is "8080" to the program. Turn on Numbers and booleans to promote clean integers, decimals, true and false. Values with leading zeros stay strings.

Does it handle continuation lines and escapes?

Yes. A line ending in a single backslash continues onto the next line with that line's leading whitespace removed. The escapes \n, \t, \r, \f, \uXXXX, an escaped space and escaped separators are decoded in keys and values, and a backslash before any other character is dropped, as the Java loader does.

What happens when a key is both a value and a prefix?

In Nested mode a JSON key cannot hold both a string and an object, so the object wins and the dropped value is listed under Warnings, for example when a=1 appears next to a.b=2. Flat mode keeps both keys unchanged.

How are duplicates handled?

The last value wins, which is what Properties.load does, and the key is listed under Warnings with every line it appeared on. The JSON keeps the key at the position where it first appeared.

What does JSON to .properties do with nested objects and arrays?

It always flattens: nested objects become dotted keys and arrays become name[0], name[1], and so on. Booleans and numbers are written as text, and null becomes an empty value.

Why does the output contain \u00fc instead of ü?

Because Properties.load(InputStream) reads the file as ISO-8859-1, so non-ASCII text must be escaped to survive. Turn off Escape non-ASCII when the file will be read as UTF-8, for example by Properties.load(Reader), Spring Boot, or a modern resource bundle.

Is my config uploaded?

No. Parsing and writing happen in your browser and no request carries the text. Third-party analytics and ads may load on the page, as on the rest of the site.

Does it merge Spring profiles or read application.yml?

No. It converts one .properties file. Profile-specific files, relaxed binding and ${placeholder} references are left as written; use Spring's own tooling for the merged view.

Is this the same as the Env JSON Converter?

No. That tool reads dotenv files, which have different quoting and comment rules and no continuation lines. This page reads Java .properties. Both write JSON and both run in the browser.

Rate This Tool

0/1000

Get Weekly Tools

Suggest a Tool