Skip to content
gohacks.dev
Tooling

Text Diff Checker

Compare two pieces of text line by line and see what was added and removed, with options to ignore whitespace and case.

Free · No sign-up · Your inputs stay in your browser

Input

Compare two texts line by line

Output

+2 -1

11 APP_ENV=production
2-APP_DEBUG=false
2+APP_DEBUG=true
33 DB_HOST=10.0.0.5
44 CACHE_STORE=redis
5+SESSION_DRIVER=redis
56 QUEUE_CONNECTION=redis

Runs in this browser. Nothing you paste is sent to a server.

Comparing configuration

Most diffs a developer runs outside Git are of configuration: a production .env against staging, two nginx.conf files, the output of the same command on two servers. Sort both sides first (the line tool does it) when order does not matter, and ignore whitespace when one side was reindented.

The algorithm

A longest common subsequence diff is the textbook method. Git defaults to the Myers algorithm, which finds a shortest edit script and usually gives the same result; on code with many repeated lines such as braces, git diff --histogram often reads better. For files, git diff --no-index a.txt b.txt works outside a repository.

Share

Frequently asked questions

Can it compare two files?
Paste the contents of each into the two boxes. For large files, git diff --no-index file1 file2 in a terminal is faster and has no size limit.
Why does a line show as changed when it looks the same?
The two lines differ in characters you cannot see, such as a trailing space, a tab or a Windows line ending. Turn on 'Ignore whitespace', or inspect the line with the whitespace cleaner.
Is what I paste sent anywhere?
No. The tool runs entirely in your browser with JavaScript. Nothing you type or paste is sent to our server or stored.

Keep planning

Similar tools