Boneyard Tools

Java Properties to JSON Converter

Paste a Java .properties file and this converter parses every key into a flat JSON object you can copy in one click. It handles both the equals and colon separators, skips hash and exclamation comments, decodes escapes such as \uXXXX, and joins backslash line continuations. Flip the Direction menu to turn a flat JSON object back into .properties text for a config file.

How to convert .properties to JSON

  1. Open the Direction menu and choose Properties to JSON (or JSON to Properties for the reverse).
  2. Paste your .properties text into the input box, or click Load sample to see the format.
  3. Read the converted JSON in the output box below, formatted with two-space indentation.
  4. If a red error appears, fix the input (for JSON to Properties it must be a single JSON object).
  5. Click Copy to put the result on your clipboard.

Examples

Dotted keys with both separators

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

Comment skipped and a \uXXXX escape decoded

# greeting
greeting=caf\u00e9
{
  "greeting": "cafΓ©"
}

JSON back to properties lines

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

Frequently asked questions

Is my file uploaded anywhere?

No. The conversion runs entirely in your browser with client-side JavaScript, so your keys, secrets and values never leave your device or touch a server.

Which separators and comments are supported?

Both key=value and key:value are parsed, using the first unescaped = or : as the split point. Lines whose first character is # or ! are treated as comments and skipped, and blank lines are ignored.

Are line continuations handled?

Yes. A logical line that ends with an odd number of backslashes continues onto the next physical line. The trailing backslash is dropped and the leading whitespace of the continuation is stripped, so app.name=Boneyard \ then Tools becomes Boneyard Tools.

Are escapes like \n and \uXXXX decoded?

Yes. In values the sequences \n, \r, \t and \f become their control characters, \uXXXX becomes the matching Unicode character, and a backslash before any other character yields that character. Going the other way, those characters are re-escaped.

Are dotted keys turned into nested objects?

No. A key like db.host is kept flat and used verbatim as the JSON key. This is the safest round-trippable mapping, since nesting on every dot would break keys that legitimately contain dots.

What happens to a key with no value?

A line with a key but no = or : separator is kept and given an empty string value. So a bare line like debug becomes "debug": "" in the JSON.

How are duplicate keys handled?

The last occurrence wins. If the same key appears twice, the value from the final line overwrites the earlier one, which matches how java.util.Properties loads a file.

What does the JSON to Properties direction require?

It expects a single flat JSON object. Arrays or non-object values raise an error, and any object or array used as a value is JSON-encoded into the properties value string rather than expanded.

Is there a size limit?

There is no fixed limit. Because everything runs locally, the practical ceiling is your device memory, and even large config files convert almost instantly.

Learn more

Related tools