Text & Code Diff
Compare two texts or code files online side by side. Additions, deletions and modified lines are highlighted with inline word changes. Runs in your browser.
Runs in your browser · Nothing uploadedFree · No sign-up
More diff checker tools
JSON Diff
Compare two JSON documents online, ignoring key order and formatting. Keys are normalised and sorted, so only real changes in values are highlighted.
Compare Excel Files
Compare two Excel or CSV files online cell by cell. See changed values, added and removed rows and new columns, matched by ID or position. Nothing is uploaded.
Something not working, or missing a feature? Send feedback
About the Text & Code Diff
This online diff checker compares two versions of any text and highlights exactly what changed: added and removed lines, plus the changed words inside modified lines. Paste text or compare two files online by opening or dropping them into the panels. It is ideal for config files, logs, contracts and code reviews without a Git repository.
Both versions are compared in your browser, so private code and documents never leave your device.
How to use the Text & Code Diff
- Paste the original on the left and the changed version on the right, or open a file in each panel. Dropping two files at once fills both sides.
- Switch between side-by-side and unified views, and ignore whitespace or case if needed.
- Copy or download the result as a unified .diff file.
Common mistakes
- Line ending differences. Files from Windows end lines with CRLF and files from macOS or Linux with LF. Turn on "Ignore whitespace" when every line shows as changed for that reason.
- Reordered content. A diff matches lines in order, so a moved block appears as removed in one place and added in another. Sort both sides first when order does not matter.
- Comparing JSON as text. Key order and formatting differences make JSON look completely different. Use the JSON Diff, which compares the data itself.
Works well with the Text & Code Diff
- JSON Diff: compare JSON by structure, ignoring key order.
- JSON Formatter: normalise formatting before a text comparison.
- SQL Formatter: format two queries the same way before comparing them.
- Compare Excel Files: compare two Excel or CSV files cell by cell.
- Compare PDF: compare the text of two PDF files.
Frequently asked questions
Are my files uploaded?
No. Files are read and compared entirely in your browser, so private code and documents stay on your device.
Can I create a patch file?
Yes. Download the unified diff; it uses the standard format that git apply and patch understand, with your file names in the header.
Side by side or unified?
Side by side is easier to read for edits within lines; unified is more compact and is the format that patch files use.
How do I compare two files online?
Choose "Open file" above each panel, or drag both files from your file manager and drop them on either panel: the first fills Original and the second fills Changed. The differences appear as soon as both sides have text.
Which file types can I compare?
Any plain-text file up to 5 MB: .txt, .csv, .log, .json, .xml, .yaml, .html, .css, source code and config files. Excel, PDF and Word files are binary: compare spreadsheets with Compare Excel Files and PDFs with Compare PDF, and copy the text of Word documents into the panels.
Is there a code diff checker for two source files?
Yes, this one. Open or drop two .js, .py, .java, .c, .php or other source files and every changed line is shown with the changed words marked inside it. Download the result as a .diff patch for a code review.
Can I compare large files?
Yes. Files of several thousand lines compare in a moment in your browser. Use "Collapse unchanged" to show only the changed regions.
Guides and tutorials
- Code Quality & Workflow
How to Read a Diff: The Unified Diff Format Explained
Understand every line of a unified diff: file headers, @@ hunk headers, context lines and + and - changes, plus git diff extras, patches and code reviews.
· 6 min read
- Programming Languages
-O0 vs -O2 vs -O3: GCC and Clang Optimization Levels Benchmarked
-O2 vs -O3 measured with GCC and Clang on five C programs: when -O3 wins, when it is slower, what -Ofast breaks, plus code size and compile time per -O level.
· 10 min read
- JSON & Data Formats
How to Compare Two JSON Files and Find the Real Differences
Why a text diff of JSON shows noise, how a semantic JSON diff ignores key order and formatting, and how to compare JSON in the browser, with jq and in Python.
· 5 min read
- Programming Languages
How to Run Python Code Online (No Install, With Input)
Run Python code online in your browser: a first program, input() and stdin, reading many lines, which modules work, and how to read a Python traceback.
· 5 min read
- Code Quality & Workflow
Prettier for PHP: Format PHP Code with @prettier/plugin-php
How to use Prettier for PHP: install @prettier/plugin-php, set up .prettierrc, choose braceStyle and phpVersion, format on save and check PHP formatting in CI.
· 7 min read
- Programming Languages
GCC vs Clang: What Is the Difference for C Programmers?
Clang vs GCC benchmarked on five programs: Clang won three, GCC one, one tie. Plus error messages, flags, GNU extensions and which to use for C and C++.
· 12 min read
Related tools
JSON Diff
Compare two JSON documents online, ignoring key order and formatting. Keys are normalised and sorted, so only real changes in values are highlighted.
Compare Excel Files
Compare two Excel or CSV files online cell by cell. See changed values, added and removed rows and new columns, matched by ID or position. Nothing is uploaded.