Text Difference
Compare two text files or snippets and highlight all additions, deletions and modifications. Supports txt, json, xml, html, css, js, ts, sql, csv, log, md.
Compare two text files or snippets and highlight all additions, deletions and modifications. Supports txt, json, xml, html, css, js, ts, sql, csv, log, md.
A text diff (short for "difference") is a line-by-line and character-by-character comparison between two pieces of text that highlights exactly what changed between them — what was added, what was removed, and what was modified. Instead of re-reading two documents side by side and hoping to spot changes by eye, a diff tool computes and visually marks the differences for you.
Diffing is the foundation of version control (Git, SVN), code review tools, and document revision tracking. The same underlying idea applies whether you're comparing two commits of source code, two drafts of a contract, or two exports of a configuration file — anywhere content evolves over time and you need to know precisely what changed.
The Text Difference tool is a side-by-side (or inline) comparison editor, built on the same Monaco diff engine that powers VS Code. Paste, type, or upload text into the Original and Modified panels and it highlights every added, removed, and modified line with color-coded backgrounds, complete with a running count of changes and quick navigation between diff sections.
It supports plain text as well as syntax-highlighted comparison for JSON, XML, HTML, CSS, JavaScript, TypeScript, SQL, CSV, log files, and Markdown, so code and structured data are easier to read while you compare. You can toggle whitespace, case, and empty-line sensitivity, collapse unchanged regions to focus on what matters, and everything runs locally in your browser — nothing you paste or upload is sent to a server.
Paste or type text into the left panel, or upload a file by clicking the folder icon or dragging a file onto it.
Paste, type, or upload the second version into the right panel the same way.
Use the dropdown in each panel header to choose a language like JSON, HTML, or SQL for syntax highlighting — this doesn't change the diff logic, only readability.
In the Options panel on the right, toggle Ignore Whitespace, Ignore Case, Ignore Empty Lines, and Collapse Unchanged Regions as needed.
Click the Compare button (or press Ctrl+Shift+C). This is required for Ignore Case and Ignore Empty Lines to take effect, since they preprocess the text before diffing.
Added lines are shaded green, removed lines red, and modified lines yellow. Use Previous/Next to step through diff sections, or switch between Side by Side and Inline view.
Copy or download either side individually, or use Swap Texts to flip Original and Modified — useful when checking a change in reverse.
Invisible characters — trailing spaces, tabs instead of spaces, or a stray space mid-line — will mark a line as modified even though it looks the same on screen. Enable "Ignore Whitespace" to filter out purely whitespace-based differences.
This usually means the two texts have different line-ending styles (Windows CRLF vs. Unix LF), often from files edited on different operating systems. Re-saving one file with consistent line endings before pasting will resolve it.
Unlike "Ignore Whitespace" and "Collapse Unchanged Regions" which apply instantly, these two options only take effect the next time you click Compare — they rewrite the text before diffing rather than changing a live display setting.
By default the diff is case-sensitive, so "Success" and "SUCCESS" register as a change. Enable "Ignore Case" and click Compare if capitalization differences shouldn't count.
For long documents or files with only a handful of changes buried in a lot of unchanged content, enable "Collapse Unchanged Regions" to hide unchanged blocks and keep the changed sections in view.
Since Original and Modified are separate drop targets, dragging a file onto the wrong panel silently overwrites that side's content. Use "Swap Texts" to correct it instead of re-uploading both files.
Comparing two paragraphs reveals a phrase changed from "every week" to "every two weeks" and a new sentence appended at the end.
Input
Our team ships new features every week. We prioritize customer feedback over internal roadmaps.
Output
Our team ships new features every two weeks. We prioritize customer feedback over internal roadmaps. Release notes are published every Friday.
Comparing two versions of a config file highlights a changed port number and a newly added feature flag line.
Input
server.port=8080 server.host=localhost logging.level=INFO
Output
server.port=9090 server.host=localhost logging.level=INFO feature.betaMode=true
These two lines differ only in letter casing. By default they show as modified; enabling "Ignore Case" and re-running Compare marks them as unchanged.
Input
Status: SUCCESS User: ADMIN
Output
Status: success User: admin
No. The comparison runs entirely client-side in your browser using the Monaco diff engine. Nothing you paste or upload is sent to a server.
Side by Side shows the Original and Modified text in two adjacent columns. Inline shows a single unified column with additions and deletions merged in place, similar to a Git unified diff.
Those two options preprocess the text (lowercasing it, or stripping blank lines) before it's compared, so they only apply the next time you click Compare or press Ctrl+Shift+C. "Ignore Whitespace" and "Collapse Unchanged Regions", by contrast, are display options that apply immediately.
The most common causes are trailing whitespace, tabs mixed with spaces, or different line-ending characters (CRLF vs. LF) between the two texts. Enabling "Ignore Whitespace" filters out whitespace-only differences.
You can upload .txt, .json, .xml, .html, .css, .js, .ts, .sql, .csv, .log, and .md files onto either panel, either through the upload button or by dragging and dropping.
Yes. Both the Original and Modified panels are fully editable. As you type, the diff updates automatically after a brief pause, and you can also trigger a full re-compare with the Compare button.
After a comparison, the stats bar counts how many lines were purely added, purely removed, or changed in place (modified), along with the total number of differing lines across both texts.