TextCompareLab

Guide: Compare config and code

Compare texts

How to compare config files and code snippets

"It worked yesterday" often comes down to one changed value: a port, a flag, a path or a version. Comparing the working file with the broken one finds that line quickly, without opening a full version control tool.

Steps

  1. Paste the working version in the original box and the current version in the changed box. Remove secrets such as passwords, tokens and keys from both first, especially if you plan to share the result.
  2. Leave "Ignore case" off. In code and config, case usually matters.
  3. Use "Ignore whitespace" when the difference you care about is not indentation, for example after a formatter ran. Leave it off for formats where indentation is meaningful, such as YAML or Python.
  4. Run the comparison, then use "Changed lines only" to see just the edits with a few lines of context.

Example

listen_port = 8080
listen_port = 8443

A single changed value is highlighted inside the line, so you can see that only the port number differs.

Tips

  • The comparison is by line. Reordered keys show as removed and added lines even when the content is the same. Sort both files first if the order is not important.
  • Keep the same line endings and quoting style in both versions, or those will show up as differences.
  • For large files, compare the relevant block rather than the whole file, so the result is quick to read.

Privacy

The comparison runs in your browser and the text is not uploaded. Even so, do not paste real credentials. The Copy and Download buttons give you the result as plain text, with lines starting with - from the original and + from the changed text.

More guides

Open the comparison tool