Data

JSON Properties Converter

Convert JSON and Java-style .properties with escaped dot notation.

Loading interactive tool…

Embed this tool on your site

About this tool

Java's .properties files are flat dot-separated key lists that Spring Boot, Android, and many Java frameworks use for externalised configuration. Modern tooling prefers nested JSON. This converter turns spring.datasource.url into a three-level nested object and flattens nested JSON back into dotted keys. Numeric key segments become JSON arrays (items.0, items.1) and arrays flatten back the same way. When reading .properties it joins backslash line continuations, skips # and ! comment lines, decodes \uXXXX, \n and \t escapes so text is readable, and accepts =, : or a space between key and value. Values are typed: true, false, null and numbers become JSON types, and values that look like JSON objects or arrays are parsed. To keep a literal dot inside a key, escape it as \. in the source. Output always uses key=value; non-ASCII text such as Café is written as-is, not as \uXXXX escapes. Java developers working with Spring Boot configs and i18n teams managing translation files use it to bridge the two formats.

Why use it

  • Dot Notation ↔ Nested Object: spring.datasource.url becomes {spring: {datasource: {url: ...}}} in JSON and converts back correctly. This preserves the hierarchical intent of Java's dot-notation convention so Spring Boot, Micronaut, and Quarkus read the properties exactly as expected.

  • Unicode Escape Decoding: \uXXXX escapes in .properties files are decoded to readable characters in JSON output (中文 instead of \u4E2D\u6587), along with \n, \t and \r escapes.

  • Multi-Line Values: Backslash line continuations where a value spans multiple lines are joined into one value when parsing, with the next line's leading whitespace removed.

  • Comment Lines Skipped: Lines starting with # or ! are recognised as comments per the Java spec and left out of the JSON.

  • Arrays Supported: Numeric key segments such as servers.0.host become JSON arrays, and JSON arrays flatten back to indexed keys, so lists survive the round trip.

  • Local-Only Conversion: Database URLs, passwords, API keys, and SMTP credentials stored in production .properties files stay in your browser tab. No data is uploaded, logged, or sent to any server during conversion.

How to use

  1. Paste JSON or .properties content into the Input box
  2. Click JSON → .properties to flatten JSON into dotted keys, or .properties → JSON to nest dotted keys
  3. Escape a dot as \. in a .properties key when it should stay part of one key instead of creating a level
  4. Check that lines use key=value without spaces around the =, which this parser reads correctly
  5. Use Swap to feed the output back in, Clear to reset, and Copy Output to grab the result

When it helps

  • Converting a Spring Boot application.properties to JSON for review, documentation, or modification by non-Java tooling
  • Migrating from application.properties to application.yml by converting properties to JSON first and then using the JSON-YAML tool
  • Extracting Android string resources exported as .properties into JSON for localisation pipeline tooling
  • Roundtripping i18n translation files between .properties (for Java runtime) and JSON (for web frontend consumption)
  • Inspecting the resolved property hierarchy of a Spring Boot application by examining the nested JSON structure
  • Converting Maven or Gradle build properties files into JSON for programmatic processing in CI scripts

Examples

Spring application.properties → JSON

Input
spring.datasource.url=jdbc:postgresql://db:5432/app
spring.datasource.username=app
spring.datasource.password=secret
server.port=8080
logging.level.root=INFO
Expected result · Scroll for more
{
  "spring": {
    "datasource": {
      "url": "jdbc:postgresql://db:5432/app",
      "username": "app",
      "password": "secret"
    }
  },
  "server": {
    "port": 8080
  },
  "logging": {
    "level": {
      "root": "INFO"
    }
  }
}

i18n strings round-trip

Input
{
  "login": { "title": "Sign in", "button": "Continue" },
  "errors": { "generic": "Something went wrong" }
}
Expected result
login.title=Sign in
login.button=Continue
errors.generic=Something went wrong

Unicode escape

Input
greeting=\u4F60\u597D
farewell=\u518D\u89C1
Expected result
{
  "greeting": "你好",
  "farewell": "再见"
}

Tips

  • Spring Boot reads both application.properties and application.yml — convert to JSON first and then use the JSON-YAML tool to produce YAML if your team is migrating formats.
  • Keys with literal dots in them need escaping as \. in the .properties source so the converter keeps them in one key instead of nesting them.
  • Remove spaces around = before converting (key=value, not key = value); otherwise the = ends up at the start of the value.
  • If an older Java runtime will read the output, convert non-ASCII text to \uXXXX escapes yourself (for example with native2ascii), since the tool writes it literally.
  • Production passwords and credentials belong in environment variables or a secrets manager, not committed to version control in either .properties or JSON format.

Frequently Asked Questions

How does dotted key notation translate to nested JSON?
Each dot in a property key acts as a level separator. The key spring.datasource.url produces a three-level JSON structure: {"spring": {"datasource": {"url": "..."}}}. The reverse conversion reconstructs the dotted key from the nested path.
Will accents and Chinese characters survive the conversion?
Yes. Escapes like \u4F60\u597D are decoded to 你好 in JSON output. When converting back to .properties, non-ASCII characters are written as literal UTF-8 text, not re-encoded as \uXXXX, which Java 9+ reads from UTF-8 files but older Java 8 code reading ISO-8859-1 does not.
Are # and ! comments preserved when going to JSON?
No. JSON has no comment syntax, so # and ! comment lines are dropped without a warning. Keep the original .properties file in version control if comments document configuration decisions.
What separator does the tool use — equals or colon?
When reading, =, : and whitespace all separate key from value. When writing .properties, it always uses = with no spaces. Note that a line written as key = value (with a space before the =) is read with the value "= value", so remove the spaces first.
Can I convert a Spring Boot application.properties file?
Yes, when lines are written as key=value without spaces around the separator, which is the common Spring Boot style. Dot-notation keys become nested JSON objects, and numbers such as server.port=8080 become JSON numbers.
How are multi-line values (with trailing \) handled?
Backslash line continuations are joined during parsing. A value split across multiple lines with trailing backslashes becomes a single string in JSON. On conversion back to .properties the value is written on one line.
How do I keep a dot inside a single key?
Escape it as \. in the .properties source, for example host\.name=x becomes {"host.name": "x"}. In the other direction, avoid dots and spaces inside JSON key names: they are not escaped in a way this parser reads back as one key.
Are passwords inside the file logged anywhere?
No. All conversion runs locally in your browser. No data is transmitted to any server. Production database passwords, SMTP credentials, and API keys in your .properties files are never exposed.

Explore the category

Glossary

Spring Boot externalised config
Spring Boot's mechanism for loading configuration from application.properties or application.yml files at startup, allowing deployment-time configuration without code changes. Properties use dot-notation keys that map to Java bean properties.
Dot-notation key
A property key that uses dots as level separators to express hierarchy in a flat key-value format. spring.datasource.url represents a three-level path: spring → datasource → url.
Java escape sequence
A backslash-prefixed code representing a special character in Java .properties files. Common examples are \n (newline), \t (tab), and \uXXXX (Unicode code point). These must be encoded correctly for the Java runtime to read the values.
Resource bundle
A set of Java .properties files with locale suffixes (messages_en.properties, messages_fr.properties) used for internationalisation. Each file contains the same keys with locale-specific translated values.
Line continuation (\)
A backslash at the end of a line in a .properties file that tells the parser to treat the next line as a continuation of the current value. Used for long values that would otherwise exceed a comfortable line length.
Unicode escape (\uXXXX)
A four-hex-digit escape sequence for representing non-ASCII characters in Java .properties files. Required where the runtime reads files as ISO-8859-1. This converter decodes these escapes but does not write them.
A LITTLE HELP. A LOT DONE.
Good tools.
Great flow.

Your shortcut to the everyday. Create, convert, calculate,
and get back to what you love.

✓ Free to use✓ No sign-up✓ 500+ possibilities