FormatterHQ

Properties to JSON Converter

Paste a Java .properties file, such as application.properties or a messages bundle, and get JSON. Dotted keys can be nested, \uXXXX escapes are decoded and continued lines are joined.

Input INI
Output JSON
Ready.

How to use the Properties to JSON Converter

  1. Paste the contents of your .properties file into the input editor.
  2. Keep Nest dotted keys on for a JSON tree, or turn it off for a flat object with the original keys.
  3. Choose whether to Convert numbers & booleans.
  4. Click Convert and copy the JSON.

Parse Java files with the properties to JSON converter

This properties to JSON converter reads the Java .properties format as defined by java.util.Properties and writes it as JSON. It is useful for moving Spring Boot settings into a JSON-based config service, turning messages_en.properties bundles into i18n JSON for a JavaScript front end, or simply inspecting a large file as a tree.

Example

# messages
! legacy comment
app.name=Acme Shop
app.greeting=Hello, W\u00f6rld
app.welcome = Welcome \
    back!
server.port: 8080
server.ssl.enabled true
path.home=C:\\apps\\acme
my\ key=spaced key

With both options on:

{
  "app": {
    "name": "Acme Shop",
    "greeting": "Hello, Wörld",
    "welcome": "Welcome back!"
  },
  "server": { "port": 8080, "ssl": { "enabled": true } },
  "path": { "home": "C:\\apps\\acme" },
  "my key": "spaced key"
}

Format rules supported

  • Separators: key=value, key: value and key value (whitespace) are all accepted, as in Java.
  • Comments: lines starting with # or !.
  • Line continuations: a trailing backslash joins the next line, and its leading whitespace is dropped, so Welcome \ + back! gives Welcome back!.
  • Escapes: \uXXXX Unicode escapes, \t, \n, \r, \f, an escaped backslash and escaped spaces or separators in keys such as my\ key.

Options explained

Nest dotted keys splits keys on dots, so server.ssl.enabled becomes nested objects. Turn it off to keep one flat object with the original keys, which is what most i18n libraries expect for message bundles. Convert numbers & booleans turns 8080 and true into JSON types; with it off, every value is a string, exactly as Properties.getProperty returns it.

Moving message bundles to a JavaScript front end

Converting the file is the easy part; the message syntax inside the values also differs between Java and JavaScript i18n libraries:

  • Placeholders. Java's MessageFormat uses numbered arguments such as Hello, {0}, while i18next expects named ones like Hello, {{name}}. Rename them after converting.
  • Doubled apostrophes. In messages that go through MessageFormat, a single quote is an escape character, so bundles often contain Don''t. A JavaScript library will show both quotes; replace '' with ' in those values.
  • Nesting. i18next splits keys on dots by default, so nested output works with t('app.name') as is. If you keep flat keys, set keySeparator: false.

Edge cases

  • A key that is both a value and a parent. With app=Acme followed by app.name=x, JSON cannot hold both, so the later line wins and app becomes {"name": "x"}. Use flat output to keep both.
  • Numeric segments such as list.0=a stay object keys ({"0": "a"}) when nesting, while Spring-style brackets like active[0]=dev become real arrays.
  • Duplicate keys: the last one wins, matching Java.

Targeting Spring's YAML format instead? Use Properties to YAML. To go back, use JSON to Properties.

Privacy

Parsing runs locally in your browser, so datasource passwords in your properties file stay private.

Frequently asked questions

Are \uXXXX escapes decoded?
Yes. Sequences like \u00f6 are turned into the real character (ö) in the JSON output, along with \t, \n, \r and \f escapes.
How do I get flat JSON instead of nested objects?
Turn off Nest dotted keys. Each property then becomes one JSON key with its original dotted name, such as "server.port".
Does it handle multi-line values?
Yes. A line ending in a single backslash continues on the next line, and the continuation's leading spaces are removed, exactly as Java does.
Why did one of my values disappear when nesting?
If a key such as app has its own value and also has children like app.name, JSON cannot store both. The later line wins; switch to flat output to keep every key.

Last updated September 26, 2026

Related tools