Java Properties ↔ JSON

Convert .properties files to and from JSON.

Open tool

Overview

The Java properties converter round-trips between .properties format and JSON. Paste a Spring Boot application.properties, a messages_en.properties bundle, or any other Java config file to get a clean JSON object — or paste JSON to generate properties syntax for a Java consumer.

It's the smoothest way to move a config between a JVM service and tools that prefer JSON (Helm values, kubectl ConfigMaps, generic environment loaders). Java developers and DevOps engineers reach for a properties to json converter when mirroring configuration into a CI pipeline or generating a config from a typed schema.

How it works

The .properties format is specified by java.util.Properties: each line is key=value or key:value, blank lines and lines starting with # or ! are comments, line continuations end with \, and Unicode characters can be escaped with \uXXXX. The parser implements those rules and decodes escape sequences (\n, \t, \=) in values.

When emitting JSON, dotted keys (server.servlet.port) become nested objects rather than flat keys — that matches what @ConfigurationProperties binders expect. The reverse pass flattens nested JSON into dotted keys before writing properties.

Examples

server.port=8080
server.servlet.context-path=/api
spring.datasource.url=jdbc:postgresql://localhost/db
{
  "server": {
    "port": "8080",
    "servlet": { "context-path": "/api" }
  },
  "spring": { "datasource": { "url": "jdbc:postgresql://localhost/db" } }
}
message=Hello\\nWorld

JSON:
{ "message": "Hello\nWorld" }

FAQ

Are values typed as numbers or booleans?

Properties values are always strings in the Java spec — there are no types. The JSON output preserves them as strings to round-trip exactly. Toggle the type-inference option if you want numeric and boolean coercion.

What about Unicode escapes?

\uXXXX escapes are decoded when reading and re-emitted when writing. If your file has non-ASCII characters stored literally, save it as UTF-8 first; legacy ISO-8859-1 files need escaping to survive the round trip.

Are XML properties files supported?

The XML variant (<properties><entry key="..."> ...) is a separate format. This tool handles the line-based plain text form only.

Try Java Properties ↔ JSON

An unhandled error has occurred. Reload ×