Properties to JSON Converter

Parses key=value (or key:value) lines from a .properties file, unflattens dot-notation keys into nested objects, and outputs the result as pretty-printed JSON. A free online tool from Staaarter, right in your browser.

Runs locallyUpdated 2026-07-22

Overview

Introduction

A Java .properties file is a flat list of key=value lines, convenient for JVM tooling but awkward to work with in JSON-based systems. This tool parses one back into a structured JSON document.

It recognizes the dot-notation convention frameworks like Spring Boot use for nested config, rebuilding that nesting as real JSON objects.

What Is Properties to JSON Converter?

A .properties parser that reads key=value (or key:value) lines, skips comment lines starting with # or !, and reconstructs a nested JSON object from dotted key paths.

It's the reverse of Convert JSON to Properties, though since .properties has no type system, all resulting values remain strings.

How Properties to JSON Converter Works

Each non-comment, non-blank line is split at its first unescaped = or : character into a key and a value; the value has its own escape sequences (\n, \r, \t, and backslash-escaped characters) decoded.

The key is then split on dots, and a nested object is built (or extended) at that path, so keys sharing a common prefix end up as sibling properties of the same nested object.

When To Use Properties to JSON Converter

Use it when migrating a Java or Spring Boot .properties config into a JSON-based system or JavaScript codebase.

It's also useful for quickly visualizing the nested structure a flat .properties file actually represents.

Features

Advantages

  • Reconstructs nested JSON objects from dot-notation keys automatically.
  • Recognizes both = and : as valid separators, matching Java's own parser behavior.
  • Runs entirely client-side.

Limitations

  • Line continuations (a trailing backslash to join two lines) aren't supported; each entry must be a single line.
  • All values remain strings; there's no automatic conversion to numbers or booleans.

Examples

Parsing a flat config

Input

app.name=api
app.debug=false
replicas=3

Output

{
  "app": {
    "name": "api",
    "debug": "false"
  },
  "replicas": "3"
}

Dotted keys under the same prefix (app.*) become properties of a shared nested object.

Best Practices & Notes

Best Practices

  • Join any line-continuation entries in your source file into single lines before pasting, since continuations aren't parsed.
  • Convert string values to numbers or booleans in your own code afterward if your JSON consumer needs typed data.
  • Use Convert JSON to Properties afterward to verify a round trip preserves the same keys.

Developer Notes

The separator is located with a regex that uses a negative lookbehind, `(?<!\\)[=:]`, so an escaped \= or \: inside a key doesn't get mistaken for the key/value boundary; values are then unescaped for \n, \r, \t, and generic backslash-escaped characters before being written into the nested object at the key's dotted path.

Properties to JSON Converter Use Cases

  • Migrating a Spring Boot application.properties file into a JSON-based config system
  • Visualizing the nested structure implied by a flat Java properties file
  • Converting legacy JVM configuration for use in a JavaScript or Node.js project

Common Mistakes

  • Pasting a .properties file that relies on line continuations, which this parser doesn't currently join.
  • Expecting numeric or boolean values automatically; everything parses as a string.
  • Mixing = and : separators inconsistently and being surprised both are accepted identically.

Tips

  • If a key looks like it didn't nest correctly, check for an unescaped dot that wasn't meant to introduce nesting.
  • Pair with Convert JSON to Properties to confirm a clean round trip for your specific config.

References

Frequently Asked Questions