FormatterHQ

JSON to Properties Converter

Turn a JSON object into a Java .properties file. Nested keys are joined with dots, arrays use key.0 or Spring-style key[0], and special or non-ASCII characters are escaped.

Input JSON
Output INI
Ready.

How to use the JSON to Properties Converter

  1. Paste a JSON object into the input editor.
  2. Choose the Array keys style: key.0, key.1 or Spring-style key[0], key[1].
  3. Click Convert.
  4. Copy the output or download it as application.properties or a message bundle.

Generate Java files with the JSON to properties converter

The JSON to properties converter flattens a JSON object into key=value lines that java.util.Properties, Spring Boot and Java resource bundles can load. Nested keys are joined with dots, and every value is escaped so that it reads back exactly as written.

Typical uses include generating application.properties from a JSON settings export, creating messages_de.properties from a translation service that delivers JSON, and feeding values into build tools such as Maven or Gradle that read properties files.

Example

Input:

{
  "app": { "name": "Acme Shop", "debug": false, "port": 8080, "greeting": "Grüße" },
  "db": { "url": "jdbc:mysql://localhost:3306/acme?useSSL=false" },
  "features": ["search", "checkout"],
  "key with space": " leading",
  "multi": "a\nb",
  "note": null
}

Output with key.0, key.1:

app.name=Acme Shop
app.debug=false
app.port=8080
app.greeting=Gr\u00fc\u00dfe
db.url=jdbc:mysql://localhost:3306/acme?useSSL=false
features.0=search
features.1=checkout
key\ with\ space=\ leading
multi=a\nb
note=

Array keys option

  • key.0, key.1 treats indexes like any other key segment. Choose it for generic tools and for bundles that are read by simple dotted-key lookups.
  • key[0], key[1] (Spring) writes spring.profiles.active[0]=dev. Spring Boot's relaxed binding maps these to a List in a @ConfigurationProperties class, so pick this for application.properties.

Reading the generated file in Java and Spring

Plain Java loads the output with java.util.Properties. Every value comes back as a string, so numbers and booleans need converting:

Properties props = new Properties();
try (InputStream in = Files.newInputStream(Path.of("app.properties"))) {
    props.load(in);
}
String name = props.getProperty("app.name");                 // "Acme Shop"
int port = Integer.parseInt(props.getProperty("app.port"));  // 8080

In Spring Boot, drop the file in src/main/resources as application.properties and bind a whole prefix at once with @ConfigurationProperties(prefix = "app") on a class or record with name, debug and port fields; Spring handles the type conversion. Keep in mind that Properties does not remember line order, so a file written back by Java code may list keys differently from the converter's output.

Escaping rules

  • Non-ASCII characters become \uXXXX escapes (ü → \u00fc). Properties.load(InputStream) reads files as ISO-8859-1, so escaping keeps accented text intact on every Java version.
  • Spaces, =, :, # and ! in keys are backslash-escaped, since they would otherwise end the key or start a comment.
  • A leading space in a value is escaped as \ ; Java strips unescaped leading whitespace.
  • Line breaks and tabs become \n and \t, and backslashes are doubled, so Windows paths survive.
  • Characters such as = and : in values are left alone, because only the first unescaped separator matters. That keeps JDBC URLs readable.

Edge cases

  • null becomes an empty value (note=); Properties has no null.
  • Empty objects and arrays are written as {} or [] text.
  • Numbers and booleans are written as text; Spring converts them to the target type when binding.

For Spring projects that prefer YAML, convert with JSON to YAML instead. To read a properties file back into JSON, use Properties to JSON.

Privacy

Everything runs in your browser; your JSON is not sent to a server.

Frequently asked questions

Why are my accented characters turned into \u escapes?
Java's Properties.load(InputStream) reads bytes as ISO-8859-1, so raw UTF-8 characters can come out garbled. \uXXXX escapes are plain ASCII and load correctly everywhere.
Which array style should I use for Spring Boot?
Choose key[0], key[1] (Spring). Spring Boot binds indexed bracket keys to lists and arrays in @ConfigurationProperties classes.
How are nested objects converted?
Their keys are joined with dots. {"spring": {"datasource": {"url": "…"}}} becomes spring.datasource.url=…, the standard Spring property name.
What happens to null values?
They are written as an empty value, for example note=. The .properties format cannot distinguish null from an empty string.

Last updated September 26, 2026

Related tools

Properties to JSON Converter Convert Java .properties files (Spring Boot, i18n bundles) to nested or flat JSON, decoding \uXXXX escapes and line continuations. Properties to YAML Converter Convert Spring Boot application.properties to application.yml, nesting dotted keys into a clean YAML tree. YAML to Properties Converter Convert application.yml / YAML into flat .properties key=value lines, with Spring-style [0] indexes for lists. JSON to Query String Build URL-encoded query strings from JSON objects, with a choice of bracket, indexed or repeated keys for arrays. JSON to SQL Converter Convert JSON to SQL online for free. CREATE TABLE and INSERT statements with escaped values. JSON to Text Converter Convert JSON to Text online for free. Readable key: value output for reports and tickets. JSON to TOML Converter Convert JSON to TOML online for free. Tables and arrays of tables are generated for you. JSON to TSV Converter Convert JSON to TSV online for free. Paste the result straight into a spreadsheet. JSON to XML Converter Convert JSON to XML online for free. Attributes, arrays and root element are configurable. JSON to YAML Converter Convert JSON to YAML online for free. Clean, readable YAML with configurable indentation. OPML to JSON Converter Convert OPML to JSON online for free. Get formatted JSON with types detected automatically. PDF to JPG Converter Convert PDF pages to JPG images (or PNG and WebP) at 72–300 DPI. Download single pages or all pages as a ZIP. Runs in your browser.