← Back

Diff Viewer

LOCAL

Compare two files and view differences.

Upload files

Result

What is Diff Viewer?

Diff Viewer compares two uploaded text files line by line at the same line positions. It prints unchanged lines with two leading spaces, old lines with a minus prefix and new lines with a plus prefix. The result is a plain-text comparison, not a color-highlighted editor, a merge operation or a Git-compatible patch.

How to use Diff Viewer

Create two small UTF-8 text files: put mode=dev in file A and mode=prod in file B. Select them using File A and File B, then choose Show diff. Expect the lines - mode=dev and + mode=prod. Copy copies the generated comparison; the source files are not modified.

When is Diff Viewer useful?

Use this view to inspect a small configuration or document edit when the corresponding lines remain aligned. If both files contain the same single line, it appears with two leading spaces rather than a “no differences” message. If either file is missing, the tool asks you to select both files before comparing.

Example

Adding a line near the beginning shifts subsequent comparisons, so many later lines can appear removed and added even if their text did not change. The tool does not align moved blocks or compute a minimal edit sequence. Empty lines and final-newline differences are not represented reliably. Treat the prefixes as a simple positional comparison, not a complete account of every file change.

Practical notes

Files are read as text in the browser, normally using UTF-8; binary files and encoding detection are outside the tool’s scope. CRLF versus LF endings can produce differences that look similar on screen. Normalize line endings outside the tool when appropriate, and keep the originals for comparison. File contents are loaded into browser memory and are not uploaded to an API. The FileReader text-reading reference describes the underlying browser operation.