← Compare

How to compare text and code

DiffTidy compares two versions of a text document in your browser. Use it for a draft, a configuration file, a script, or a small log. Start with the original on the left and the updated version on the right. On a phone, the input panels stack vertically and the result starts in a unified view.

1. Add two versions

Paste text or choose Open file on each panel. Dragging a file onto either panel also works. Files are read locally; there is no upload endpoint. Each side accepts valid UTF-8 text up to 2 MiB and 30,000 lines. A PDF, Word document, image, spreadsheet workbook or binary file is not plain text. Export its text first. CSV, Markdown, JSON, YAML and source-code files can be compared as text.

2. Choose what matters

Words make changes to sentences easy to read. Characters expose small changes in identifiers and numbers. Lines highlight complete changed lines and are useful for large comparisons. Ignore spacing collapses runs of horizontal spaces and tabs and trims the ends of each line; it does not remove every space within a sentence. Ignore case uses Unicode lowercase comparison. Ignore line endings, enabled initially, treats LF, CRLF, CR and a missing final newline as equivalent when the line text matches.

Ignored changes remain in the original input. A result can therefore say “Match with current options” without the files being byte-for-byte identical. Turn the ignore options off to inspect the exact differences. Unicode normalization is not performed: visually similar characters can still be different.

3. Review and restore

Select Compare or press Ctrl/⌘ + Enter. Green rows with a plus sign were added; red rows with a minus sign were removed. A replacement can appear as one removal and one addition. The counts measure lines, not a similarity percentage. Use the arrows or Alt + ↑/↓ to navigate change groups. Changes only hides unchanged lines, and Wrap lines keeps long content within the panel.

Restore original replaces one changed block in the updated version with the corresponding original block. It immediately compares again. Undo reverses the last tool action, including restore, swap, file open and clear. Up to six such actions are retained in this tab; typing a manual edit clears that tool-action history. The browser’s own text-editing undo remains separate. Whitespace and case changes ignored by your options are not silently overwritten by a block restore.

4. Take the result with you

Copy and Download text use the complete updated input. Download patch creates a standard unified patch from the exact two inputs, regardless of display ignore options. The patch uses generic names, original.txt and updated.txt. Download report creates a standalone HTML comparison that you can open locally, print, or save as a PDF using your browser. Reports contain the compared text: share them only with intended recipients. No public share link is created.

Large files and performance

Comparison runs in a separate Web Worker. Results are paginated in groups of 160 aligned rows. Very complex comparisons stop after a bounded time and ask you to compare a smaller section. Some long lines fall back to line-level highlighting while keeping their content intact. Live comparison is optional and runs only while the combined text length is at most 200,000 UTF-16 code units; larger inputs use the Compare button.

What happens to your work?

Input text and filenames stay in tab memory. DiffTidy does not save comparisons to localStorage, IndexedDB, a database or a server. Reloading, closing the tab or following a page link can discard your work. Download or copy it first. Switching the language inside the comparison page preserves the current input. Only your language preference is saved on the device. Advertising and analytics are separate services described in the privacy notice.

Compare code safely · Compare JSON accurately · Understand whitespace and line endings