🔍

Text Diff & Compare Tool

Compare two texts, files, or documents side-by-side. Spot additions, deletions, and character-level modifications in real-time, 100% locally.

Original Text (Source A)

Paste text or drop files (.txt, .json, .xml, .sql, .csv, .pdf, .docx)

📁Drag & Drop file or click to browse

Changed Text (Source B)

Paste text or drop files (.txt, .json, .xml, .sql, .csv, .pdf, .docx)

📁Drag & Drop file or click to browse
⚙️

Regex Noise Filtering: Practical Examples

Use these regular expression patterns in the filter input to ignore dynamic data and prevent "fake" differences in your comparison reports.

Timestamps\d{4}-\d{2}-\d{2}[T\s]\d{2}:\d{2}:\d{2}(?:\.\d+)?Z?

Ignores ISO/UTC timestamps in application logs or JSON payloads.

UUIDs / GUIDs[0-9a-fA-F]{8}-(?:[0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}

Filters out randomly generated unique identifiers and transaction IDs.

IPv4 Addresses\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b

Ignores server, client, or proxy IP addresses in audit logs.

Hashes (MD5/SHA)\b[0-9a-fA-F]{32,64}\b

Ignores checksums, file hashes, or encrypted passwords.

Emails[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}

Ignores dynamic customer or user email addresses.

Session Tokensey[a-zA-Z0-9_-]+\.ey[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+

Ignores JWTs (JSON Web Tokens) or session authorization headers.

Database IDs\b\d+\b

Ignores numerical IDs when comparing logs or SQL tables.

HTML Tags<[^>]*>

Strips out all markup tags to compare raw text content.

Hex Colors#[0-9a-fA-F]{3,6}

Ignores inline hex color codes in CSS or SVG files.

URL Query Params\?[^#\s]*

Filters out tracking query parameters (like UTM tags) in URL lists.

Inline Comments\/\/.*

Ignores single-line code comments in JS, Java, or C++.

Trailing Spaces[ \t]+$

Ignores trailing tabs and spaces at the end of lines.

File Paths(?:[a-zA-Z]:\\|\B)\\[\w\s.]+\\[\w\s.]+|(?:\/\w+)+

Ignores absolute or relative paths in logs or configs (Windows/Unix).

JSON Keys"[a-zA-Z0-9_]+"\s*:\s*

Filters out JSON keys to compare only the raw values.

HTML Attributes\s[a-zA-Z0-9_-]+="[^"]*"

Strips HTML attributes (class, id, href) to compare raw tag structure.

SQL & Block Comments\/\*[\s\S]*?\*\/|--.*

Ignores multi-line SQL comments or C-style block comments.

Overview & Capabilities

Compare and analyze differences between two text blocks or files instantly and securely. Our Text Diff & Compare tool runs 100% client-side, ensuring your data never leaves your device. Perfect for developers, editors, and QA teams, it provides word-level and character-level highlighting, custom regex noise filtering, and format-aware beautification for JSON, XML, SQL, and CSV. Easily upload .txt, .pdf, or .docx files to get a detailed comparison report.

Tutorial

How to Use

01
Paste your original text in the left pane (Source A) and the changed text in the right pane (Source B). Alternatively, drag and drop or upload files.
02
Select a format preset (e.g., JSON, XML, SQL, CSV) if you want to automatically beautify and normalize the inputs before comparing.
03
Adjust comparison settings, such as ignoring letter case, collapsing multiple whitespaces, or ignoring empty lines.
04
Click 'Compare Texts' to run the Myers diffing engine in a background thread.
05
Review the highlighted differences in Split (side-by-side) or Unified (inline) view, check the Similarity Health Score, and copy or export the diff report.
Capabilities

Key Features

100% Client-Side Privacy: Your data is processed entirely in your browser, keeping sensitive keys and code completely secure.
Multi-Format File Support: Compare plain text (.txt), PDFs (.pdf), Word documents (.docx), JSON, XML, HTML, SQL queries, and CSV files.
Interactive Word-Level Highlighting: Spot exact word-level and character-level changes within modified lines.
Smart Formatting & Beautification: Auto-indent JSON, XML, and SQL queries to eliminate formatting noise before comparing.
Regex-Powered Noise Filtering: Ignore timestamps, transaction IDs, or UUIDs using custom regular expressions.
Page Similarity Health Score: Calculates a weighted percentage match to give you an instant overview of document similarity.
Split and Unified Views: Choose between side-by-side dual-pane view or inline unified view with synchronized scrolling.
Applications

Common Use Cases

Developers comparing code files, configuration values, or API payloads.
System administrators auditing log files and ignoring timestamp differences.
Content editors comparing drafts, articles, or legal contracts for revisions.
Database administrators comparing SQL schemas or data dumps.
QA engineers verifying localized text files and translation keys.
Guidance

Tips & Best Practices

💡
Use the 'Ignore Whitespace' option when comparing code or JSON files where indentation difference is not important.
💡
When analyzing server logs, enter a regex filter (e.g., \d{4}-\d{2}-\d{2}) to ignore timestamp differences and focus only on error messages.
💡
If comparing JSON files, select the 'JSON' format preset to auto-format and sort keys, preventing mismatched line order from cluttering the diff.
💡
Use the 'Copy Unified Diff' button to quickly get a standard Git-style patch to share with your team.
Answers

Frequently Asked Questions

Q Is my data secure when using this Text Diff tool?

Yes, 100%. The tool runs entirely in your local browser using HTML5 FileReaders and Web Workers. No text, document, or file content is ever uploaded to a server, making it perfectly safe for sensitive code, API keys, and private documents.

Q Which file formats and extensions are supported?

You can upload plain text (.txt), Adobe PDF (.pdf), Microsoft Word (.docx), JSON (.json), XML/HTML (.xml, .html), SQL (.sql), and CSV (.csv) files. PDF and Word documents are parsed and converted to plain text locally for comparison.

Q How does the Custom Regex Ignore Filter work?

The custom regex filter allows you to define patterns (like dates, timestamps, or session IDs) to ignore. The tool will replace matches of this pattern with a placeholder before running the comparison, preventing minor variable changes from creating noise in your diff report.

Q Can I compare very large files?

Yes. In a web browser environment, a 'large file' is typically anything above 5 MB to 10 MB (approximately 100,000+ lines of text). This tool is highly optimized and capable of processing files up to 15 MB to 20 MB entirely client-side. For files exceeding 5 MB, character-level highlighting is automatically disabled to optimize memory and rendering performance, but line-level and word-level diffing remain fully active.