Comparing two files in Windows sounds like a five-second task — until you
realize Windows ships four completely different tools for it, none of them called
diff. This guide cuts through the confusion: seven concrete methods from the
30-second Properties panel trick to PowerShell Compare-Object, the
fc command, WinMerge, and a browser-based option that needs zero admin
rights. Every method gets real command examples you can paste straight into your terminal.
Pick the one that fits your situation and move on.
Why Compare Files on Windows?
The need to compare files comes up constantly in day-to-day Windows work: you want to know whether a config backup differs from the live file, whether two versions of a script are actually the same, whether a file was silently modified during a deployment, or whether two colleagues' exported CSVs agree. The exact scenario shapes which tool is right.
A few situations where comparing two files in Windows is non-negotiable:
- Config management — diff
web.configbefore and after a deploy to catch unintended changes. - Code review on locked machines — corporate Windows boxes often block Git GUI tools; you need a no-install option.
- Audit trails — prove a log file or policy document was not tampered with by comparing its hash.
- Data validation — two teams generate the same CSV report independently; you need to verify they match row-by-row.
- Troubleshooting — a service stopped working after an update; compare the old and new INI files to find the culprit line.
One important clarification up front: diff is not a Windows native
command. It originates from Unix/Linux. Windows ships fc.exe (File
Compare) as its built-in equivalent, and PowerShell offers Compare-Object. If
you type diff in Command Prompt and it works, you have Git for Windows or WSL
installed — those ship the Unix diff binary. We cover all paths below.
Method 1: File Properties — The 30-Second Check
Before reaching for any command-line tool, check file metadata. Right-click both files in Explorer → Properties. Look at three numbers:
- Size — if the sizes differ, the files are definitely different. Done.
- Date modified — same size but different timestamp? Likely different content (but not guaranteed — an identical save from a different editor can update the timestamp).
- Size on disk — a sanity check that rules out cluster-alignment tricks.
This approach takes 30 seconds and catches the obvious cases. It fails when two files are the same size but have different content — for example, a one-character typo in a 10 MB log file. When Properties are not enough, reach for one of the methods below.
Power-user tip: You can select two files in Explorer, right-click, and choose Properties to see a combined panel. The sizes will be listed individually, making a quick visual comparison trivial.
Method 2: fc Command — The Built-In Classic
fc.exe (File Compare) is the closest Windows has to a native
diff windows command — and the canonical answer when people ask for the
windows diff command. It ships with every version of Windows — including
Windows 10 and 11 — and runs from Command Prompt without any installation. Microsoft
documents the full flag reference in the
official fc command docs on Microsoft Learn.
To use it, open Command Prompt (Win+R, type cmd, press Enter)
and run:
fc file1.txt file2.txt
If the files are identical, fc prints:
FC: no differences encountered If they differ, it prints the mismatched sections with context lines around each difference, making it easy to spot exactly what changed. Here is the full set of useful flags:
| Flag | Meaning | Example |
|---|---|---|
/b | Binary comparison (byte-by-byte) | fc /b image.png image_backup.png |
/c | Case-insensitive text comparison | fc /c config.txt config_new.txt |
/l | ASCII / text mode (default for .txt) | fc /l report.csv report_v2.csv |
/n | Show line numbers in output | fc /n script.ps1 script_new.ps1 |
/u | Unicode text comparison | fc /u readme.md readme_v2.md |
/w | Compress whitespace (treat runs of tabs/spaces as equal) | fc /w formatted.json minified.json |
Real-world example — comparing two config files:
fc /n "C:\inetpub\wwwroot\web.config" "C:\Backups\web.config.bak"
The /n flag adds line numbers to the output so you know exactly which lines
changed without counting manually.
Limitations of fc: It cannot recurse into directories, has no GUI, and its binary mode only reports whether files differ — it does not show which bytes changed. For anything more sophisticated, move to PowerShell.
For a deeper dive into PowerShell's native diff capabilities — including Compare-Object, Get-FileHash, and folder recursion — see our companion guide on PowerShell diff: comparing files like a pro.
Method 3: PowerShell Compare-Object
PowerShell's Compare-Object cmdlet (aliased as diff inside
PowerShell sessions) is the modern Windows answer to the Unix diff command and
the most flexible windows file compare tool that ships in the box.
Unlike fc.exe, it works on objects — meaning you can compare text
lines, CSV rows, registry keys, or any structured data using the same pattern. The full
cmdlet reference lives on
Microsoft Learn (Compare-Object).
Basic text file comparison:
Compare-Object (Get-Content .\file1.txt) (Get-Content .\file2.txt) Output uses SideIndicator to mark which file owns each unique line:
InputObject SideIndicator
----------- -------------
Line only in file2 =>
Line only in file1 <=
Lines marked => exist only in the right (second) file. Lines marked
<= exist only in the left (first) file. Lines present in both files are
suppressed unless you add -IncludeEqual.
Show all lines including matches:
Compare-Object (Get-Content .\file1.txt) (Get-Content .\file2.txt) -IncludeEqual Case-insensitive comparison:
Compare-Object (Get-Content .\file1.txt) (Get-Content .\file2.txt) -CaseSensitive:$false Quick identity check with Get-FileHash (fastest method for large files):
# Returns True if files are byte-for-byte identical
(Get-FileHash .\file1.txt).Hash -eq (Get-FileHash .\file2.txt).Hash Save diff output to a report file:
Compare-Object (Get-Content .\file1.txt) (Get-Content .\file2.txt) |
Export-Csv -Path .\diff-report.csv -NoTypeInformation
The key advantage of the PowerShell windows diff command approach over
fc.exe is pipeline integration. You can filter, sort, format, and export
results in the same one-liner. For structured data like CSVs, swap
Get-Content for Import-Csv and add -Property
to compare specific columns:
Compare-Object (Import-Csv .\export_old.csv) (Import-Csv .\export_new.csv) `
-Property Name, Email, Status Compare-Object terminal output: green => lines are unique to the new file; red <= lines are unique to the old file.PowerShell is the right choice when you need scripted, repeatable comparison — for example, in a CI/CD pipeline that validates config files after each deploy, or in a scheduled task that emails a diff report when files change.
Method 4: Windiff.exe — Microsoft's Forgotten Tool
windiff.exe is a graphical diff tool that Microsoft shipped as part of the
Windows SDK and Support Tools packages through the Windows XP and Vista era. It is no
longer bundled with modern Windows 10/11, but if you have an older Windows machine or a
legacy SDK installed, you may find it in:
C:\Program Files (x86)\Windows Kits\10\bin\x64\windiff.exe When available, Windiff offers a rudimentary two-pane GUI that highlights differences in red and green. You can compare individual files or entire directories. It is genuinely useful for a quick visual sanity check on a machine that has it — but given that WinMerge is free, actively maintained, and far more capable, there is little reason to seek Windiff out on a modern system.
Verdict: Use Windiff only if it is already on the machine and you need a fast visual check without downloading anything. For anything new, skip straight to WinMerge.
Method 5: WinMerge — The Open-Source Favorite
WinMerge is the community standard for graphical file comparison on Windows. It is free, open-source (GPL), and actively maintained at winmerge.org. The installer is available via winget, Chocolatey, or the project's website:
winget install WinMerge.WinMerge Once installed, you can open WinMerge from the Start menu and use its GUI, or drive it from the command line for batch workflows:
WinMergeU /e /u "C:\path\to\file1.txt" "C:\path\to\file2.txt" Key flags for command-line use:
| Flag | Effect |
|---|---|
/e | Close WinMerge with Escape key (script-friendly) |
/u | Do not add paths to the Most Recently Used list |
/r | Recurse into subdirectories (folder compare mode) |
/x | Close automatically if files are identical |
/dl / /dr | Set custom left/right panel labels |
/cfg | Pass a specific config setting inline |
WinMerge strengths:
- Side-by-side visual diff with syntax highlighting for 50+ file types
- 3-way merge support (v2.16+) — ideal for resolving Git conflicts on Windows
- Folder comparison with recursive diff across entire directory trees
- Archive support (ZIP, 7z) — compare files inside archives without extracting
- Plugin system for custom filters and transformations
- Shell integration — right-click two files in Explorer → "WinMerge"
WinMerge integrates with the Windows shell context menu on install, so comparing two files in Windows becomes as simple as selecting both files in Explorer, right-clicking, and choosing WinMerge. For most power users, this is the workflow that sticks.
One constraint: WinMerge requires a full installer. On a locked-down corporate Windows box where you lack admin rights, installation is blocked. In that case, jump to Method 7.
Method 6: Beyond Compare and Paid Options
For teams that compare files daily — developers, DBAs, release managers — a paid tool pays for itself quickly. The market leader is Beyond Compare by Scooter Software, available at $30–$60 per seat depending on edition.
Beyond Compare's headline features:
- Session management — save frequently used comparison pairs and reload them in seconds
- Rules-based filtering — ignore whitespace, timestamps, version strings, or custom regex patterns
- 3-way merge — baseline + two modified versions with conflict resolution UI
- FTP/SFTP/cloud compare — compare local files against remote servers directly
- Binary hex view — byte-level visual diff for executables and database files
- Table compare — CSV/TSV aware, with column alignment and row matching
- Scripting — automate comparisons with BComp.exe from the command line
BComp.exe "C:\old\config.ini" "C:\new\config.ini" /fv="Text Compare" Other paid options worth knowing: Araxis Merge (strong 3-way merge, popular with legal teams), UltraCompare (bundled with UltraEdit), and P4Merge (free from Perforce, but requires a Perforce account sign-up).
For a full breakdown of how Beyond Compare stacks up against its rivals, see our guide on Beyond Compare alternatives.
Method 7: Online Browser Tools — No Install Required
This is the method most Windows users overlook — and the one that solves the most common corporate pain point: you cannot install software on your work machine. Group Policy restrictions, UAC lockdowns, and IT approval queues block WinMerge, Beyond Compare, and even Git for Windows on millions of enterprise Windows desktops.
Browser-based diff windows tools need nothing except a modern browser. No admin rights. No installer. No IT ticket.
Diff Checker is a Chrome extension available at diffchecker.pro that runs a full side-by-side text diff directly in your browser. What makes it different from web-based diff tools that upload your content to a server:
- No upload — your text never leaves the browser tab. Processing is local.
- No account required — open it and start comparing immediately.
- No admin rights — installs as a browser extension, not a system app.
- Side-by-side view — additions in green, deletions in red, with line numbers.
- Works on any Windows version where Chrome or Edge runs — including Windows 7, 8, 10, and 11.
web.config files — no installation beyond the browser extension required.The workflow is straightforward: open the extension, paste or type your two texts into the left and right panels, and the diff appears instantly. No keyboard shortcut to memorise, no CLI flags to look up.
This is the right choice for: ad-hoc comparisons, sharing a diff with a non-technical colleague (copy the URL), and any situation where you need a visual result in under ten seconds without touching a terminal.
Need to compare files on a locked-down Windows machine? Install Diff Checker Free — runs in your browser, no admin rights required.
Comparison Table: Which Tool Wins?
| Tool | Install needed? | Free? | GUI / CLI | Binary diff | Folder compare | Best for |
|---|---|---|---|---|---|---|
| File Properties | No | Yes | GUI | No | No | Quick size/date sanity check |
| fc.exe | No (built-in) | Yes | CLI | Limited | No | Quick one-off CLI text diff |
| PowerShell Compare-Object | No (built-in) | Yes | CLI | Via Get-FileHash | Yes (manual) | Scripted automation, CSV/structured data |
| Windiff.exe | SDK required | Yes | GUI | No | Yes | Legacy machines with SDK installed |
| WinMerge | Yes (free) | Yes | Both | Yes | Yes | Daily visual diffing and merging |
| Beyond Compare | Yes (paid) | Trial | Both | Yes | Yes | Teams, complex merges, FTP/cloud compare |
| Diff Checker (browser) | Browser ext only | Yes | GUI | No | No | No-install, locked-down corporate Windows |
Decision Tree: Which Method, When?
Not sure which tool to reach for? Work through this decision tree:
- Do the files have different sizes?
Yes → They are different. You're done. (File Properties)
No → Continue. - Do you need to know which lines changed?
No → Usefc file1 file2or Get-FileHash for a quick identity check.
Yes → Continue. - Are the files binary (executables, images, databases)?
Yes → Usefc /b(basic) or WinMerge hex view (detailed).
No → Continue. - Do you need a visual side-by-side GUI?
No → UsefcorCompare-Objectfrom the terminal.
Yes → Continue. - Can you install software on this machine?
No → Use Diff Checker browser extension (Method 7). No admin rights required.
Yes → Continue. - Do you compare files frequently or need 3-way merge?
No → WinMerge (free, open-source, does everything most users need).
Yes → Beyond Compare or Araxis Merge (session management, scripting, cloud compare).
Comparing Folders and Binary Files in Windows
Folder comparison with robocopy
The fc command cannot recurse into directories. For a quick folder diff from
the command line, robocopy with the /l (list-only) flag shows
what would be copied without actually copying anything — effectively a directory
diff:
robocopy "C:\FolderA" "C:\FolderB" /l /e /njh /njs /ndl /fp /ns Files listed in the output exist in FolderA but not FolderB, or differ between them.
For a Windows-native folder diff that shows both directions (files in B but not A), pair two robocopy runs or use PowerShell:
# Compare-Object on directory listings
$a = Get-ChildItem -Recurse "C:\FolderA" | Select-Object -ExpandProperty FullName
$b = Get-ChildItem -Recurse "C:\FolderB" | Select-Object -ExpandProperty FullName
Compare-Object $a $b For a more complete treatment of Windows folder comparison — including how to handle identical filenames with different content — see our dedicated article on how to tell which files are different in Windows folders.
Binary file comparison
The fastest binary check is a hash comparison. Two files with the same SHA-256 hash are byte-for-byte identical:
$h1 = (Get-FileHash "C:\app\installer_v1.exe" -Algorithm SHA256).Hash
$h2 = (Get-FileHash "C:\app\installer_v2.exe" -Algorithm SHA256).Hash
if ($h1 -eq $h2) { "Identical" } else { "Different: $h1 vs $h2" }
For a byte-level visual diff (showing which bytes changed), use WinMerge's hex
view or fc /b:
fc /b "C:\app\installer_v1.exe" "C:\app\installer_v2.exe" The output shows the hex offset and byte values for each difference — useful for patching workflows or verifying firmware files. For deeper binary analysis, see our binary file comparison guide.
Advanced: WSL diff and Git for Windows
If you work on Windows 11 with WSL (Windows Subsystem for Linux) enabled, you have access
to the full Unix diff utility — the same one that ships on macOS and Linux.
Launch a WSL terminal and run:
diff /mnt/c/path/to/file1.txt /mnt/c/path/to/file2.txt
This produces unified diff output that is patch-compatible — you can pipe it to
patch or commit it to a Git repository. Git for Windows (available at
git-scm.com)
ships its own diff binary and adds it to PATH, so after installation
diff file1.txt file2.txt works in both Command Prompt and PowerShell.
For the full Unix workflow, see our companion guide on
Linux file comparison methods.
Windows 11 Sandbox also offers a clean environment for testing file comparison tools without affecting your main system — Sandbox is available in Pro, Enterprise, and Education editions of Windows 11. Spin up a Sandbox instance, copy the files in, and test the comparison approach without risk.
Troubleshooting Common Errors
'fc' is not recognized as an internal or external command
This typically means you are running fc from a non-standard shell or a
restricted PowerShell session. fc is a Command Prompt (cmd.exe)
built-in, not a standalone executable. In PowerShell, fc is an alias for
Format-Custom — to run the File Compare utility from PowerShell, call it
explicitly:
cmd /c fc file1.txt file2.txt Compare-Object returns nothing (no output)
If Compare-Object produces no output, the files are identical — that is the
expected result. Compare-Object only outputs differences. To confirm the files
are truly identical, use:
Compare-Object (Get-Content .\file1.txt) (Get-Content .\file2.txt) -IncludeEqual If all lines show ==, the files match perfectly.
fc reports differences in identical-looking files
The most common cause is line endings. A file saved on Linux uses LF (\n)
while Windows traditionally uses CRLF (\r\n). fc in ASCII mode
is sensitive to this difference. To normalize line endings before comparing, use PowerShell:
(Get-Content .\file1.txt) -join "`n" | Set-Content .\file1_unix.txt
(Get-Content .\file2.txt) -join "`n" | Set-Content .\file2_unix.txt
Compare-Object (Get-Content .\file1_unix.txt) (Get-Content .\file2_unix.txt) WinMerge "Access Denied" on network files
WinMerge respects Windows file permissions. If you see "Access Denied" on a network share, run WinMerge as Administrator (right-click → Run as administrator) or ensure your account has read access to both paths.
Large files cause PowerShell Compare-Object to hang
Get-Content loads the entire file into memory before Compare-Object starts.
For files larger than 200 MB, switch to Get-FileHash for an identity check
first. If the hashes differ and you need line-level details, use fc which
streams the file rather than loading it fully.
For Notepad-based comparison workflows — useful when you just want to eyeball two small text files — see our guide on comparing files with Notepad and Notepad++.
Frequently Asked Questions
How do I compare two files in Windows?
Windows offers several built-in ways. The quickest is the fc command in
Command Prompt: run fc file1.txt file2.txt and it reports all differing lines.
For scripted or structured-data comparisons, use PowerShell:
Compare-Object (Get-Content file1.txt) (Get-Content file2.txt). For a visual
side-by-side GUI, install WinMerge (free). If you cannot install software, open
diffchecker.pro in
any browser — no admin rights required.
What is the diff command in Windows?
Windows does not ship a native diff command — that is a Unix/Linux utility.
The Windows equivalents are fc.exe (File Compare, in Command Prompt) and
PowerShell's Compare-Object cmdlet. You can get the Unix diff
on Windows by installing Git for Windows (which adds git diff and a
standalone diff.exe to your PATH) or by enabling WSL.
Does Windows have a built-in file compare?
Yes. fc.exe (File Compare) ships with every version of Windows from MS-DOS
through Windows 11. Run it from Command Prompt as fc file1 file2. For text
files it reports differing lines; with the /b flag it performs a binary
byte-by-byte comparison. PowerShell's Compare-Object is another built-in
option, better suited for scripting and structured data.
How to compare two text files in Windows 11?
Open Command Prompt (Win+R → cmd → Enter) and run:
fc "C:\path\to\file1.txt" "C:\path\to\file2.txt". If the files are identical,
fc prints FC: no differences encountered. If they differ, it lists the mismatched
sections. For a visual result, install WinMerge (free from winget:
winget install WinMerge.WinMerge) or use the Diff Checker browser extension.
Can I compare files in Windows without installing anything?
Yes — two ways. The fc command and PowerShell Compare-Object are built into Windows and need no installation. For a graphical result without installing anything system-wide, use the Diff Checker browser extension — it installs as a Chrome/Edge extension (no admin rights) and runs the diff locally in your browser tab.
Compare files in your browser — no install, no upload, no admin rights.
Works on any Windows version where Chrome or Edge runs.
Get Diff Checker Free