Matching lines must be exactly equal
Spaces, tabs, letter case, and line endings inside the split text can affect equality. The algorithm does not ignore formatting differences unless you normalize the inputs first.
Compare two code blocks with syntax-highlighted side-by-side and unified diff views.
The diff viewer identifies unchanged, inserted, and removed lines and can display the result in unified or split form. It uses a longest common subsequence table to find an ordered set of lines shared by both inputs. This favors a readable line-level comparison without pretending to understand programming-language syntax.
A concrete input and expected output from the current implementation.
Input
Original: const mode = "light"; start(); Modified: const mode = "dark"; start();
Expected output
- const mode = "light"; + const mode = "dark"; start();
The changed assignment is represented as one removed line and one added line. The call to start remains unchanged.
Spaces, tabs, letter case, and line endings inside the split text can affect equality. The algorithm does not ignore formatting differences unless you normalize the inputs first.
A one-character edit marks the complete line as removed and added. Character-level highlighting and language-aware refactoring detection are outside this viewer.
Line-level diff represents replacement as removal of the old line and insertion of the new line. That preserves both exact versions.
No. Unified and split views present the same computed sequence in different layouts.
The example and behavioral notes were checked against the browser implementation. Standards and primary references below define the relevant format, formula, or platform behavior.
Format, validate, and beautify JSON with syntax highlighting and error detection.
Encode text or files to Base64 and decode Base64 strings back to their original form.
Format and indent SQL queries for better readability across all major dialects.
Convert HTML markup into clean Markdown syntax with support for tables and lists.
Write Markdown and see the rendered HTML output in real time with live preview.
Visualize unified diffs and patch files with color-coded additions and deletions.