# Diff Tool — Text & Code Compare

Paste or drop two versions and see added and removed lines, plus the exact words that changed inside each line. Copy or save the result as a unified patch. Nothing leaves your browser.

- URL: https://tools.itlibra.com/en/diff-tool
- On-device・No upload
- Last updated: 2026-11-27

## How to use

1. Paste the original text or code on the left and the changed version on the right. You can also choose a file or drop one onto a pane.
2. The diff updates as you type. Use “Try a sample” to see how it looks.
3. Turn on “Ignore whitespace”, “Ignore case” or “Ignore blank lines” to hide noise.
4. Switch between “Side by side” and “Unified”. Words that changed inside a line get a stronger highlight.
5. Use “Copy patch” or “Save .diff” to export a unified patch with 3 lines of context.

## Use cases

- Check a config file, SQL script or source file before and after an edit for unintended changes
- Find what changed between two drafts of a contract, article or meeting notes
- Share changes as a .diff file where Git is not available
- Look past line-ending or indentation differences to the real change
- Compare expected and actual output from logs or tests

## What it does

### Word-level highlights inside changed lines

Paired changed lines are compared again by word, symbol and Japanese script run, so only the part that changed is emphasized. If two lines share very little, the whole line is marked to stay readable.

### Minimal diffs with Myers’ algorithm

Lines are compared with the Myers O(ND) algorithm, which finds the script with the fewest additions and removals. Common head and tail lines are stripped first, so small edits in big files stay fast.

### Side by side or unified

Switch between a numbered two-column view and a git-style unified view. In side-by-side mode a removed line and its replacement sit on the same row.

### Ignore options

Ignore all whitespace within lines, letter case, or blank lines, independently. Ignored differences are not counted in the totals.

### Unified patch export

Outputs ---/+++ headers and @@ hunks with 3 lines of context, in the format used by patch and git apply. File names you load are used in the headers.

### Fully local

Comparison runs in JavaScript in your browser. Neither the text nor the file names are uploaded, so it is safe for confidential code and documents.


## Supported formats

### Open

- Text and source files (.txt .md .json .xml .html .css .js .ts .py .sql .yml .csv .log and more)
- UTF-8 / UTF-16 BOM / Shift\_JIS (auto-detected)

### Export

- Unified diff (.diff)
- Copy to clipboard


## Capability matrix

| Feature | Support | Notes |
| --- | --- | --- |
| Line diff (added / removed / unchanged) | Supported | — |
| Word-level highlights inside lines | Supported | By word, symbol or script run — not by single character |
| Side-by-side and unified views | Supported | — |
| Ignore whitespace, case, blank lines | Supported | — |
| Unified patch export | Supported | Fixed 3 lines of context |
| Three-way merge / conflict resolution | Not supported | — |
| Applying a patch (patch / git apply) | Not supported | — |
| Folder or binary comparison | Not supported | — |
| Detecting moved lines | Not supported | A moved line shows as a removal plus an addition |
| Offline use | Supported | Works without a connection once loaded |

## Limits & notes

- Up to 20,000 lines and 2 million characters per side are compared. Anything beyond that is left out of the diff and the patch, and a notice is shown.
- Files up to 10 MB each can be opened.
- When the edit distance exceeds 4,000, the remainder is treated as “all removed, all added” and a notice is shown.
- Only the first 3,000 diff rows are drawn on screen; the exported patch contains everything.
- Line endings (CRLF / LF) are ignored when comparing lines. Patches use LF and a missing newline at end of file is not detected.
- Works on smartphones, but side-by-side view scrolls sideways inside its table; for detailed review, use a PC or the “Unified” view.

## Privacy & safety

Your text and files are compared only inside your browser. Nothing is uploaded or stored, and file names and contents are never put in analytics logs. Closing the page discards everything.

## FAQ

### How do I compare two texts?

Paste the original on the left and the changed version on the right. Added lines are green, removed lines red, and the words that changed inside a line are highlighted more strongly.

### Can I ignore whitespace or case differences?

Yes. The compare options let you ignore whitespace, letter case and blank lines separately — handy for checking a commit that only reindented code.

### Can it produce a git-style patch?

“Save .diff” and “Copy patch” output the unified format with ---/+++ headers and @@ hunks plus 3 lines of context, readable by the patch command.

### Does it work with large files?

Up to 20,000 lines and 2 million characters per side are compared; beyond that only the beginning is used and you are told. Small edits in large files are processed quickly.

### Is my text uploaded anywhere?

No. The comparison runs entirely in your browser and your text is never sent to LIBRA Works or any third party.

### Does it highlight single characters or moved lines?

Highlights inside a line work by word or symbol, not single characters. Moved lines are not detected; they appear as a removal and an addition.
