Compare two texts and highlight differences. See added, removed, and unchanged lines.
Diff checking is the process of comparing two texts line by line to identify additions, deletions, and unchanged content, commonly used for code reviews and document versioning.
1 lines, 0 chars
1 lines, 0 chars
Formula
LCS(A, B): dp[i][j] = dp[iā1][jā1]+1 if A[i]=B[j], else max(dp[iā1][j], dp[i][jā1])LCS = Longest Common Subsequence ā the largest set of lines shared in the same order by both texts
dp[i][j] = Length of the LCS for the first i lines of A and j lines of B
Added / Removed = Lines in B not in LCS (added) or lines in A not in LCS (removed)
Worked Example
Compare: ["cat","dog"] vs ["cat","fish","dog"]
Did you know? The LCS algorithm has O(mĆn) time complexity where m and n are line counts. The Unix diff command (1974) uses a similar algorithm ā it was one of the first tools to implement this technique for text comparison.
Sources
Convert text to ASCII codes and back. Supports decimal, hex, binary, and octal formats.
Convert width/height to aspect ratios, scale dimensions, and generate responsive embed CSS for any layout.
Calculate required internet bandwidth based on devices and activities in your household.
Encode and decode Base64 strings. Convert text for data URIs, APIs, and safe data transmission.
Create CSS border-radius with visual controls for each corner. Generate circles, pills, and custom shapes.
Create CSS box shadows with multiple layers, live preview, and copy-ready code.