๐Ÿ†š DIFF (Text Comparison)

Compare two texts line by line and show which lines were added or removed.

How to use

  1. Enter the original text (A) on the left and the text to compare (B) on the right.
  2. Click "Compare".
  3. Added lines are shown in green, removed lines in red.

๐ŸŽฏ Use Cases

Example

Input
Original (A)
name: web
version: 1.0.0
port: 8080

Compare (B)
name: web
version: 1.1.0
port: 8080
debug: true
Output
  name: web
- version: 1.0.0
+ version: 1.1.0
  port: 8080
+ debug: true

A line-by-line comparison of two config files. The changed version line is split into a removal (-) and an addition (+), while the debug line that exists only in B is shown as an addition (+).

How does the LCS algorithm work?

This tool uses LCS (Longest Common Subsequence), the same family of algorithm behind git diff. It finds the longest sequence of lines that appears in both texts in the same relative order, then marks only the lines outside that sequence as added or removed. This means that if a few lines are inserted or deleted in the middle, the remaining identical lines are still correctly recognized as "unchanged" โ€” a naive index-by-index comparison would instead treat every line after the insertion point as different, which LCS avoids.

MethodBehaviorDownside
Naive line-index comparisonMatches lines 1:1 by the same indexA single inserted line makes everything after it look different
LCS-based (this tool)Finds the common subsequence and shows the minimal diffA fully reordered line shows up as a removal + addition

FAQ

What unit is used for comparison?
Comparison is done line by line. Even if only a word within a line differs, the whole line is marked as changed.
Is my text sent to a server?
No. Comparison uses an LCS (longest common subsequence) algorithm and runs entirely in your browser.
What happens if lines are just reordered?
Even identical content is shown as a removal (-) at its old position and an addition (+) at its new position, because LCS only recognizes common lines that keep their relative order.
Can I upload files to compare?
Currently only pasted text is supported. Open the file, copy its contents, and paste them in.

๐Ÿ†š Learn more: How to Compare Two Text Files (Diff Checker)

Quickly spot differences between two versions

More Text Tools

๐Ÿ“
Markdown Preview
Live-preview Markdown as HTML
๐Ÿ”—
URL Encoder/Decoder
Percent-encode/decode URL characters
โœ๏ธ
Find & Replace
Search & replace with regex support
โ†•๏ธ
List Sorter
Sort a list & remove duplicates
๐Ÿ“ง
Email Extractor
Extract & dedupe emails from text
๐Ÿ”ข
Character Counter
Count characters, bytes, lines & words
๐Ÿ” 
Case Converter
Convert to UPPER/lower/Title Case
๐Ÿ”ค
Fullwidth/Halfwidth Converter
Convert fullwidth chars โ†” halfwidth ASCII
๐Ÿˆš
Unicode Inspector
Check code points & look up characters
๐Ÿ”Ÿ
Text to Decimal
Convert text โ†” decimal code points
๐Ÿงพ
Text to Hex
Convert text โ†” UTF-8 byte hex
0๏ธโƒฃ
Text to Binary
Convert text โ†” UTF-8 byte binary
๐Ÿ”ก
ASCII Art Generator
Turn text into an ASCII art banner