Skip to main content

Java .properties File Formatter

Format and beautify Java .properties files. Normalizes key=value / key:value / whitespace separators to a consistent one, fixes spacing, joins backslash line continuations, and preserves comments and \uXXXX escapes. Optionally sort keys, align separators, remove duplicates, or strip comments.

Input

Output

Formatted .properties
 
Was this helpful?

Guides

Clean up and standardize any Java .properties file in your browser. Paste messy configuration — mixed =, :, and whitespace separators, inconsistent spacing, duplicate keys, wrapped continuation lines — and get back a tidy, consistently formatted result you can copy or download as application.properties.

Java .properties files store configuration as flat key=value pairs and are used everywhere in the JVM ecosystem: core Java SE, Spring Boot, Logback, Hibernate, and ResourceBundle for internationalization. Because the format is so permissive, real-world files drift into three or four different styles at once. This formatter parses them the way the JVM's own Properties.load does, then re-emits everything in one clean style.

How to use it

  1. Paste your .properties content into the input box (or click Try an example).
  2. Pick a Separator (=, :, or preserve the original) and the Spacing around it.
  3. Choose how to handle Comments and toggle any of: sort keys, remove duplicates, align separators, collapse blank lines.
  4. Copy the formatted output or download it.

Everything runs entirely in your browser — your configuration never leaves your device, which matters when a properties file holds database URLs, credentials, or API keys.

What it understands

  • Separators. A key and value may be separated by =, :, or a run of whitespace. The tool detects the first unescaped separator, so an escaped \= or \: correctly stays part of the key.
  • Comments. Lines whose first non-blank character is # or ! are comments. You can preserve them, normalize them all to one marker, or strip them entirely.
  • Line continuations. A line ending in a backslash (\) continues onto the next physical line; the tool joins them into a single logical entry and drops the continuation's leading whitespace, exactly like the JVM.
  • Escapes and Unicode. Escape sequences such as \n, \t, \\, and \uXXXX Unicode escapes are preserved verbatim — the tool reformats layout, it does not decode values, so your file stays byte-for-byte correct where it counts.

Formatting options

  • Sort keys alphabetically — reorders entries; any comment directly above a key travels with it.
  • Remove duplicate keys — keeps the last occurrence, matching how Properties.load resolves collisions.
  • Align separators into a column — pads keys to equal width so every = lines up.
  • Collapse multiple blank lines — reduces runs of empty lines to one.

Trailing whitespace is always trimmed from emitted lines.

Is this the same as an INI formatter?

No. Unlike INI, .properties has a flat namespace with no [section] headers — hierarchy is expressed through dotted keys like spring.datasource.url. The parser here follows the Java specification rather than INI conventions.

Does it validate my file?

It's lenient by design: it best-effort formats whatever you paste and never rejects input, so you can use it on partial or in-progress files.

javapropertiesconfigformatterbeautifyspring booti18n

Love the tools? Lose the ads.

One payment clears every ad from your account, for good. No subscription, no tracking.