Compare two .properties files

A text diff of two config files tells you the lines differ; this tells you which settings differ. Both files are parsed into keys and values first, so a reordered file, a changed separator or a moved comment produces no noise at all — what is left is the keys only one side defines and the values that changed. Copy the missing entries straight out as properties to paste into the file that is short of them.

Guide

Why a text diff is the wrong tool for two config files

Environment configs drift in two ways that matter — a key one file has and the other does not, and a key both have with different values — and in several that do not: order, separator style, comments, whitespace. A line diff cannot tell those apart, so the real differences arrive buried in false ones.

Comparing the parsed keys instead removes every difference that a properties loader would also ignore.

What a line diff reports

- logging.level.root=DEBUG
- cache.ttl.seconds=60
- spring.jpa.show-sql=true
- dev.only.toggle=on
- server.port = 8080
+ server.port=8080
+ spring.jpa.show-sql=false
+ cache.ttl.seconds=300
+ logging.level.root=WARN
+ prod.only.replicas=4

9 changed lines

What actually differs

differs   logging.level.root
          DEBUG → WARN
differs   cache.ttl.seconds
          60 → 300
differs   spring.jpa.show-sql
          true → false
only in A dev.only.toggle
only in B prod.only.replicas

3 changed, 1 missing each way
server.port is identical

server.port appears in the line diff only because one file writes it with spaces around the =. The key comparison drops it, and the reordering, on the floor.

Where people get caught

Only-in-A is usually the interesting half

A key the production file is missing falls back to a default nobody chose. A key only production has is normally deliberate. The two directions are counted and copied separately for exactly that reason.

A duplicated key is compared on the value that wins

If one file defines a key twice, the comparison uses the last definition — the one that loads — rather than reporting a difference against a value the application never sees.

Invisible differences look like phantom changes

A value with a trailing space differs from one without, and so does True against true. Both are real to a properties loader, so they are reported by default — switch on "ignore surrounding spaces" or "ignore case" when you know they do not matter.

Empty is not missing

password= in one file and no password line in the other are different states: the first defines an empty string, the second leaves the setting undefined. They are shown as "empty" and "—" rather than being treated as the same thing.

About the .properties comparer

How it works in 4 steps · 4 common use cases · 4 questions answered

How it works

  1. 1.Paste one file into each side — dev and prod, before and after, your file and a teammate’s.
  2. 2.Both are parsed into keys and values, so ordering, separator style and comments never show up as differences.
  3. 3.Every key is marked differs, only in A, only in B or identical, with the counts at the top and a filter for each.
  4. 4.Copy the entries one side is missing straight out as .properties text, or the changed values as a two-column report.

Common use cases

  • Checking an application-prod.properties against application.properties before a release
  • Finding the setting that differs between a machine where it works and one where it does not
  • Reviewing a config change without reading a diff full of reordered lines
  • Auditing what a new environment file is still missing

FAQ

How is this different from the text diff checker?

The diff checker compares lines. This parses both files first, so reordering, a = changed to a :, added comments and changed indentation produce no differences at all — only keys and values do.

What happens if a key is defined twice in one file?

The comparison uses the last definition, matching what java.util.Properties loads. The properties viewer is the page that flags duplicates themselves.

Can I get the missing entries out as a file?

Yes — "Copy A → B gaps" gives you every entry A has and B does not, already written as key=value lines ready to paste into B, and the other button does the reverse.

Are the two files uploaded anywhere?

No. Both are parsed in your browser, so comparing a production config with a local one does not send either to a server.