Compare two blocks of code or text side by side and instantly highlight every addition, deletion and change — line-by-line diff with colour-coded output.
Paste the original (before) version into the left panel. This is the baseline you are comparing against.
Paste the modified (after) version into the right panel. Both panels support any language — code, JSON, YAML, Markdown or plain text.
Hit Compare and every changed line is highlighted in green (added), red (removed). Copy the diff report or download it.
Any plain text — source code in any language (JavaScript, Python, PHP, Java, C++, Ruby, Go, CSS, HTML, SQL), configuration files (YAML, JSON, XML, TOML), documentation (Markdown, plain text). The tool is language-agnostic and performs character and line comparison without parsing or understanding the syntax.
A line diff highlights entire lines that changed — if one character differs the whole line is marked. A word diff goes further and highlights the specific words within each changed line. This tool shows line-level changes with colour coding: green for additions, red for deletions, and context lines in white to preserve readability of the surrounding code.
Yes — click the Upload File button above either panel to load a text file from your device. Supported formats include .js, .ts, .py, .php, .css, .html, .json, .yaml, .xml, .md, .txt and any other plain text file. Files are read locally in your browser — nothing is uploaded to any server at any point.
By default the diff is whitespace-sensitive. Toggle the Ignore Whitespace option to treat all whitespace as equivalent. This is useful for comparing code that has been reformatted or auto-indented where you only care about logical content changes rather than formatting differences.
Yes — JSON and YAML are plain text and can be compared directly. For best JSON results paste through a formatter first for consistent indentation. For YAML ensure both versions use consistent indentation style. The diff output clearly shows which keys changed, were added or removed.
Unified diff is the standard format used by git diff and patch tools. It uses +++ and --- headers to identify files, @@ markers for changed sections, + prefix for additions, - prefix for deletions and context lines with no prefix. This tool outputs a unified-style diff for compatibility with code review systems and documentation.
This tool performs the same fundamental comparison as git diff but entirely in your browser without Git installed. It is ideal for one-off comparisons — checking a config snippet, reviewing a before/after change, or comparing code from a colleague without needing a repository or version control workflow.
Yes — click Download Diff to save the result as a .diff file in unified format with + and - line prefixes. You can also copy the plain diff text to clipboard. The downloaded file is compatible with git apply and patch utilities for applying the diff to source files.
Long files are compared efficiently using the Myers diff algorithm. Only changed sections and a configurable number of context lines are shown in the output — unchanged sections are collapsed with a @@ ... @@ marker. This keeps the output readable even when comparing large files with a small number of changes scattered throughout.
Yes — all comparison processing runs entirely in your browser using JavaScript. Neither the original nor modified version is transmitted to any server. This is important for comparing proprietary source code, internal configuration files, secrets in config files and sensitive technical content.