JSON to Properties Converter

Converts nested JSON into the flat key=value line format used by Java .properties files, with nested keys joined by dots and special characters escaped per the properties spec. A free online tool from Staaarter, right in your browser.

Runs locallyUpdated 2026-07-22

Overview

Introduction

Java applications, and frameworks built on top of the JVM like Spring Boot, commonly configure themselves through flat .properties files rather than nested JSON. Converting between the two by hand for anything beyond a few keys is tedious.

This tool flattens a JSON document into the dot-notation key=value format .properties files expect, in one step.

What Is JSON to Properties Converter?

A converter that recursively walks a JSON value and emits one key=value line per leaf value, joining nested object keys with dots and indexing array items numerically.

It follows the Java Properties class's escaping rules for keys and values, so the result loads correctly with standard Java properties-parsing code.

How JSON to Properties Converter Works

The tool recursively descends into the parsed JSON, building a dotted path for each key (app.name, env.0, and so on) until it reaches a scalar value, at which point it emits one escaped key=value line.

Keys escape characters that have special meaning in the properties format, and values escape backslashes and common control characters, keeping the output loadable by standard Java tooling.

When To Use JSON to Properties Converter

Use it when migrating configuration from a JSON-based system into a Java or Spring Boot application that expects .properties files.

It's also useful for quickly seeing what a nested JSON config looks like fully flattened.

Features

Advantages

  • Automatically flattens arbitrarily nested JSON into a flat key list.
  • Follows standard Java properties escaping rules.
  • Runs entirely client-side.

Limitations

  • Type information (numbers, booleans) is lost; everything becomes text, as .properties files have no type system.
  • Comments and key ordering conventions from a hand-written .properties file can't be reconstructed from JSON alone.

Examples

Flattening a nested config

Input

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

Output

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

Nested keys join with dots; scalar values are written as plain text after the equals sign.

Best Practices & Notes

Best Practices

  • Review array-derived keys (env.0, env.1) to confirm the indexed naming fits your target framework's conventions.
  • Re-add any comments your original .properties file had manually, since JSON can't carry them.
  • Use Properties to JSON afterward to double check the round trip preserves the structure you expect.

Developer Notes

Escaping follows the Java Properties file format's own rules: keys escape `=`, `:`, whitespace, `#`, `!`, and backslash characters (since any of those would otherwise be misread as the key/value separator or a comment marker), while values escape backslashes and \n/\r/\t control characters, matching how java.util.Properties.load() expects its input to be encoded.

JSON to Properties Converter Use Cases

  • Migrating a JSON config into a Spring Boot application.properties file
  • Generating Java-compatible configuration from a JSON source of truth
  • Reviewing a fully flattened view of a nested JSON config

Common Mistakes

  • Expecting numeric or boolean types to be preserved on the Java side without explicit parsing.
  • Losing hand-written comments when regenerating a .properties file from JSON.
  • Not accounting for array index keys (env.0, env.1) when the target framework expects a different array convention.

Tips

  • If your target framework uses a different array convention (e.g. comma-separated single values), post-process the array-derived keys manually.
  • Pair with Properties to JSON to verify a round trip.

References

Frequently Asked Questions