Properties to JSON Converter

Convert a Java .properties file to JSON and JSON back to .properties, right in your browser. Your config never leaves your device.

Java Properties ↔ JSON runs entirely in your browser. The .properties files and JSON you paste never leave your device and nothing is uploaded to ArrayKit.

Built and maintained by Udit Agarwal

Open the dotenv to JSON Converter

About Java Properties ↔ JSON

Java Properties ↔ JSON reads a Java .properties file — the key=value config format used by Spring, Maven, and countless JVM apps — and turns it into a clean JSON object you can drop into a modern config pipeline. It skips blank lines and '#' or '!' comments, joins backslash line continuations, and decodes \uXXXX and \n \t \\ escapes inside values. Turn on 'Expand dotted keys' and dotted keys like db.host automatically nest into a db: { host } object; turn it off to keep dotted keys flat. Flip the direction to go the other way and a JSON object becomes valid .properties text, with nested objects flattened back into dotted keys and special characters escaped. It is built for Java and Spring developers migrating config between legacy properties files and JSON-based tooling. Everything runs locally — your configuration never leaves the browser.

Features

  • Convert a Java .properties file into a JSON object in one paste
  • Turn a JSON object back into valid .properties text
  • Expand dotted keys like db.host into nested JSON objects
  • Toggle nesting off to keep dotted keys flat instead
  • Skips blank lines and '#' or '!' comment lines
  • Joins backslash line continuations across multiple lines
  • Decodes \uXXXX unicode escapes and \n \t \\ in values
  • Runs entirely in your browser with no config uploaded

How to use the Java Properties ↔ JSON

  1. Keep 'Properties → JSON' selected and paste your .properties file
  2. Toggle 'Expand dotted keys (nested)' on or off as needed
  3. Copy the JSON output or download it as config.json
  4. Switch to 'JSON → Properties' to reverse the conversion

Example

Input

db.host=localhost
db.port=5432

Output

{
  "db": {
    "host": "localhost",
    "port": "5432"
  }
}

Dotted keys like db.host expand into a nested db object when nesting is on.

Common errors & troubleshooting

  • Dotted keys like db.host stay flat instead of nesting in the JSON. — Turn on 'Expand dotted keys (nested)' so keys split on '.' become nested objects, or leave it off if you want a single flat key per line.
  • 'JSON → Properties' reports the JSON must be an object. — A .properties file is a set of key/value pairs, so the input must be a single JSON object at the top level, not an array or a bare string or number.
  • A multi-line value in the .properties file gets cut off. — End the first line with a single unescaped backslash so the converter joins it with the next line into one logical value, matching how Java's Properties.load reads it.
  • Accented or non-Latin characters look wrong after converting. — Properties files traditionally use \uXXXX escapes for non-ASCII text. The converter decodes those automatically, so paste the raw escaped .properties text rather than a pre-decoded copy.

Frequently asked questions

What does the Java Properties ↔ JSON converter do with dotted keys?
With 'Expand dotted keys (nested)' on, a key like db.host=localhost becomes { "db": { "host": "localhost" } }. Turn the toggle off to keep the literal key "db.host" as a single flat property instead.
Does the Properties to JSON converter support \uXXXX unicode escapes?
Yes. Values containing \uXXXX sequences (the standard way Java's Properties format encodes non-ASCII text) are decoded to the actual character, along with \n, \t, and \\ escapes.
Can I use ':' or whitespace instead of '=' in my .properties file?
Yes. The parser accepts key=value, key:value, and key value (separated by whitespace), matching how Java's Properties.load() reads all three separator styles.
How does JSON to Properties handle nested JSON objects?
Nested objects are flattened into dotted keys, so { "db": { "host": "x" } } becomes db.host=x. Arrays and other non-object values are converted to their string representation.
Does this tool ignore comments in a .properties file?
Yes. Lines starting with '#' or '!' are treated as comments and skipped, matching the two comment markers Java's Properties format recognizes.
Is my .properties file or JSON config uploaded anywhere?
No. Java Properties ↔ JSON runs entirely in your browser. The .properties text and JSON you paste never leave your device and are not sent to ArrayKit or any server.

Related tools

  • dotenv to JSON — Convert a .env file to JSON and JSON back to .env, with quoting and comments handled.
  • INI to JSON — Convert INI config files to JSON and JSON back to INI, with sections and comments.
  • YAML ↔ JSON — Convert YAML to JSON and back.
  • TOML Formatter & Converter — Format and validate TOML, and convert TOML ↔ JSON.
  • JSON Formatter — Beautify, minify and validate JSON with error locations.
  • CSV to JSON — Convert CSV or TSV to JSON with type inference and nested keys, in your browser.

Guides

More Code Formatters tools

  • YAML ↔ JSON — Convert YAML to JSON and back.
  • Markdown Preview — Render Markdown to HTML with a live preview.
  • Regex Tester — Test regular expressions live with matches, groups and flags.
  • CSS Color Converter — Convert between HEX, RGB and HSL with a live swatch.
  • Text Diff — Compare two texts line-by-line and see additions and removals.
  • MDX Converter — Render MDX as formatted text, convert HTML → MDX, and escape text to literal MDX.
  • CSS / SCSS Formatter — Beautify or minify CSS/SCSS/LESS, sort properties and remove duplicates.
  • JS / TS Formatter — Beautify JavaScript, TypeScript and JSX/TSX with Prettier options, or minify plain JavaScript.
  • HTML Formatter — Beautify or minify HTML, format inline CSS/JS, and preview the result.
  • XML Formatter — Beautify, minify and validate XML, and convert XML ↔ JSON.
  • SQL Formatter — Format SQL for MySQL, PostgreSQL, SQL Server, SQLite, BigQuery and Oracle.
  • GraphQL Formatter — Format or minify GraphQL queries and schemas, validate syntax and extract operations.

See all Code Formatters tools (32) · All tools