Skip to content
Devtoolry

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

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

  1. 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.
  2. Switch between side-by-side and unified views, and ignore whitespace or case if needed.
  3. 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

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