Compare two files byte-for-byte with fc /b

The built-in file compare tool reports whether two text or binary files differ and shows every mismatching byte with its hex offset.

WindowsFilesdeveloperDiagnosticsLow risk
Run `fc /b file1.bin file2.bin` for a binary diff — identical files print 'FC: no differences encountered'.

01Command

Command
$ fc /b file1.bin file2.bin

02What it does

Without switches fc performs a line-by-line ASCII comparison suited to text and logs; /b switches to byte comparison where it prints each mismatch as an offset plus the two hex byte values. For text files, /n shows line numbers, /c ignores case, /w squeezes runs of spaces and tabs, and /a abbreviates long blocks of differences. fc sets the ERRORLEVEL: 0 when files match, 1 when they differ, which makes it easy to drive scripts. For very large binary files the byte dump gets long, so consider hashing instead (`certutil -hashfile file1.bin SHA256`) when you only need equality.

03Risk

RiskLow risk
RequirementsNo elevation needed; fc is built into Windows CMD.
!Warning: fc only compares two files at a time and loads files into memory — huge multi-GB files may be better verified via SHA256 hashes.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

  • fc | Microsoft Learn
    Microsoft · vendor-doc · 2026-09-17
    Evidence: Microsoft documents fc /b as performing a binary comparison, displaying every differing byte with its offset.
  • File Compare - fc - Windows CMD
    SS64 · technical · 2026-09-17
    Evidence: SS64 lists fc switches including /b for binary comparison, /c to ignore letter case, and /n to show line numbers in ASCII mode.

Last verified: 2026-09-17 · Category: Files & Folders

06Related solutions