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.
01Command
$ fc /b file1.bin file2.bin02What 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
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- fc | Microsoft LearnEvidence: Microsoft documents fc /b as performing a binary comparison, displaying every differing byte with its offset.
- File Compare - fc - Windows CMDEvidence: 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
Diagnose NTFS file system errors and bad sectors on any volume — including the system drive while Windows is running — before committing to a repair.
One pipeline that renames every matching file in a folder using regular expressions — safer and far more flexible than third-party renamers.
Turn any PNG into JPEG, BMP into PNG, and more using .NET's built-in imaging library — scriptable, batchable, zero third-party tools.