truecompare.app Open the app

How to compare code, SQL and config files

Whether it is a database migration, a Kubernetes manifest or a single source file, you often need to see exactly what changed between two versions without committing them to a repository first. This guide shows how to diff code, SQL and configuration files in the browser.

Compare two files in three steps

  1. Open the code tool. Go to the code, SQL and config workspace.
  2. Add both versions. Paste the original on the left and the modified version on the right, or drop files such as .sql, .py, .java, .yaml, .xml, .env or .txt.
  3. Review the hunks. Changed lines are grouped into hunks. Step through them one at a time; within a changed line, the exact characters that differ are highlighted.

The language is detected automatically (SQL, YAML, XML/HTML, ENV/INI, general code or plain text). You can also pick it yourself from the Language menu.

Choose a view

  • Split side by side: old and new versions in two panes that scroll together.
  • Unified inline: a single column with old and new line numbers, like a code review.
  • Unified patch: a standard .diff / .patch file that works with git apply and the GNU patch tool.

Ignore what doesn't matter

  • Ignore whitespace / indentation: reformatted code doesn't show up as changed.
  • Ignore blank lines and Ignore case, useful for SQL keywords written in different case.
  • Collapse unchanged context hides long stretches of identical lines.

A similarity score and counts of added, removed and modified lines give a quick sense of how big the change is.

Typical uses

  • Reviewing a SQL schema migration before running it against production.
  • Finding configuration drift between two environments' YAML or .env files.
  • Comparing a file from a colleague with your own version.
  • Creating a patch file to apply elsewhere.

Frequently asked questions

Is it safe to paste files that contain passwords or API keys?

The comparison runs entirely in your browser and nothing is uploaded, so secrets in .env files never leave your device. Still, treat them with the usual care on shared computers.

Can I export the result?

Yes: as a .diff/.patch file, a CSV audit, an Excel report or a PDF report.

How is this different from git diff?

It produces the same kind of line diff, but you don't need a repository, a terminal or to commit anything. Paste two versions and compare.

Try it now: free, no sign-up, nothing uploaded