- The fc command compares files in text (ASCII/Unicode) or binary mode with options to ignore case, spaces, and tabs.
- Key parameters: /a (abbreviated output), /b (binary), /w (compress spaces), /n (line numbers), /lb (buffer) and / (resynchronization).
- It supports wildcards and returns exit codes (0 equal, 1 different, 2 error); alternatives include Windiff and Comp.

If you work daily with Windows and you are concerned about detecting changes between versions of documents, scripts or binaries, the command fc It is an efficient tool that saves you time by accurately showing where two files differ. This built-in utility compares content and highlights discrepancies in both text (ASCII/Unicode) and byte (binary) modes..
Beyond basic usage, FC offers powerful parameters to tailor the comparison to your needs: ignore case, compress spaces, number lines, manage tabs, working with wildcards o adjust resynchronization. By mastering these options you will be able to evaluate real differences and avoid false positives due to formatting or spacing..
What is FC and where is it available?
The objective of fc is direct: compare two files or sets of files and display the differences. It is a tool of the Windows ecosystem that comes as a traditional executable, and on many computers it is located in C:\WINDOWS\fc.exe. En PowerShell There is an alias called fc that points to Format-Custom; therefore, to avoid conflicts in PowerShell, it is advisable to run explicitly fc.exe when you want to compare files.
Various sources indicate that fc is available in Windows 12, 11, 10 and in server editions such as MS Server 2025, 2022 or 2019. In addition, there are implementations in other environments such as FreeDOS, with an expanded set of options and some of its own behaviors that we will also discuss below.
Syntax of the fc command
The canonical syntax in Windows covers comparisons in text and binary. You will find two main forms, one for ASCII/Unicode mode and one for binary mode:
fc /a ] <archivo1> <archivo2>
fc /b <archivo1> <archivo2>
In practical terms, file1 y file2 They are mandatory, with their routes if applicable, and from there you choose the options that fit your comparison. To view built-in help, use fc /? in console commands (CMD).
Most useful parameters and options (Windows)
The set of modifiers allows you to fine-tune the analysis. These are the most relevant ones in the documented Windows FC:
- /a: abbreviated output for text comparisons. Instead of listing all the distinct lines, shows only the first and last line of each difference block.
- /b: binary mode, compares byte by byte without resynchronizing after the first mismatch. This is the default mode if the extensions are .exe, .com, .sys, .obj, .lib, or .bin.
- /c: ignores case differences during text comparison.
- /l: ASCII text mode, compares line by line and attempts to resynchronize after a mismatch. This is the default mode for text files.
- /lb: sets the size of the internal line buffer in number of lines. By default they are 100 lines; if there are more than 100 different consecutive lines, FC cancels the comparison.
- /n: displays line numbers during an ASCII comparison.
- /off: includes files with the "offline" attribute, which are otherwise omitted.
- /t: does not convert tabs to spacesThe default behavior is to treat tabs as spaces with a break every 8 columns.
- /u: compares files as Unicode text.
- /w: compresses white spaces (tabs and spaces) when comparing. With /w, fc treats long sequences of spaces as a single ignores spaces at the beginning and end of the line.
- /: number of consecutive lines that must match after a difference to consider that the files have been synchronized again. The default value is 2.
- Routes and names (archive): indicate the location of the files to be compared; both names are required.
- /?: show help on the console.
When you make a comparison ASCII, fc formats the output with a specific pattern so you can understand at a glance what changed. The typical order is: first file name, distinct lines from the first, first line that matches both, second file name, distinct lines from the second, and first line that matches again..
In comparisons binaries, mismatches are displayed with a different address and byte format. The notation you will see follows the scheme:
<XXXXXXXX: YY ZZ>
Here, XXXXXXXX is the relative address in hexadecimal from the start of the file, and YY/ZZ are the different hexadecimal values in file1 y file2 respectively. Addresses start at 00000000 and advance as fc traverses the bytes.
Wildcards, buffers and special messages
Fc admits jokers (* y ?) in file names. If you use a wildcard in the first argument, will compare all files that match the pattern against the file (or set) specified in the second argument. If the wildcard is in the second argument, fc reuses the corresponding name from the first argument..
For ASCII comparisons, fc uses a internal buffer capable of holding 100 lines by default. If the files exceed this range without being able to resynchronize with matches, fc stops and displays:
Resynch failed. Files are too different.
When comparing binary files larger than the available memory, fc does not fail: processes both in parts, overlapping the next portion in memory and maintains the same output as if they fit completely.
Practical examples of use
Comparing two text reports and viewing the abbreviated result is as simple as running: in ASCII mode with difference block summary:
fc /a monthly.rpt sales.rpt
If you would like to compare two batch files in binary and see the addresses where the bytes differ, try:
fc /b profits.bat earnings.bat
The output may include lines such as addresses and bytes in hexadecimal, and if one is longer a warning of the type will appear FC: earnings.bat longer than profits.bat. If both files are identical, fc will indicate that there are no differences. with a message similar to:
Comparing files profits.bat and earnings.bat
FC: no differences encountered
You can also cross-reference a file with all .bat files in the current directory:
fc *.bat new.bat
Or compare a file with its namesake on another drive:
fc c:new.bat d:*.bat
Y for match by name all .bat files in the root of C: with those in D:
fc c:*.bat d:*.bat
Working from CMD step by step
If you prefer a guided tour, you can open the Symbol of the system as administrator, move to the working folder and run the comparisons. Example:
- Open CMD with elevated permissions from the search engine.
- Navigate to folder containing the files, for example:
cd C:\Users\tuusuario\Downloads. - Compare in normal mode (text):
fc archivo1.txt archivo2.txt. - Compare in ASCII (line by line):
fc /L archivo1.txt archivo2.txt. - See summary blocks when only the first line changes:
fc /a archivo1.txt archivo2.txt. - Compare in Unicode where appropriate:
fc /u archivo1.txt archivo2.txt. - Apply wildcards To compare many TXT files with one file:
fc *.txt archivo1.txt.
Keep in mind that If you run these commands in PowerShell, to avoid the alias to Format-Custom, use fc.exe explicitly (for example, fc.exe /a ...). This way you make sure to invoke the file comparator.
Key Differences: ASCII/Unicode vs. Binary
In mode ASCII o Unicode, fc understands the concept of line and allows number them (/n), ignore case (/c), compact spaces (/w) or respect tabs (/t). This is ideal for code, reports, configurations and any text files..
Mode binary (/b) treats the file as a sequence of bytes. Does not resynchronize after the first mismatch and is the ideal way to verify that two executables, libraries or other binaries are exactly the same. If you need to validate byte-by-byte integrity, this is your way..
In addition to choosing the mode, you can adjust the resynchronization in text comparisons with / to require more (or less) equal lines after a misalignment before realigning. The default value is 2.
For noisy room comparisons, use /w and you will forget about differences due to tabs or extra spaces, while /t It helps you when you want tabs to count as real tabs. These two options make a difference in tabbed files or those with various indentations..
Dumping results and large files
When the output is large, reading it in the console may be impractical. Redirects output to a file to analyze it calmly or look for patterns:
fc archivo1.txt archivo2.txt > diff.txt
So you save the full report en diff.txt and you can open it with your favorite editor, share it, or version it. This trick is especially useful with logs or very long lists.
Exit codes
If you call fc from scripts or automated tasks, you are interested in its exit code. On windows, the most common signs are:
| Exit code | Meaning |
|---|---|
| 0 | The files are identical. |
| 1 | The files are different. |
| 2 | An error occurred during the comparison. |
In the variant of FreeDOS others are documented ERRORLEVEL additional related to invalid parameters or failures when opening/locating files. Remember that semantics may vary between platforms..
Integrated alternatives and related utilities
In addition to fc, Windows has additional utilities that can be very useful depending on the scenario. Windiff.exe provides a graphical interface to view text differences and visually compare folders. In Windows 2000 and later it was included in Support\Tools on the original CD (installable with Setup.exe), and also within Support.cab of each Service Pack. In Windows NT 4.0 it was distributed with the Resource Kit.
With Windiff you can compare two files or entire directory trees, alternating between a outline mode (status summary) and a expanded mode (line-by-line differences). Results are color-coded., and from the menu you can focus only on the left file, the right file, or both. It also supports command line launch and has a help file (Windiff.hlp).
Another classic console tool is Comp.exe, valid for comparing ASCII and binary files, even between teams. A typical example for contrast dlls between machines would:
comp C:\Winnt\System32\*.dll \\DifferentComputerName\C$\Winnt\System32\*.dll
If you need to verify that a local file and remote file are identical and you can't compare them directly, a historical resource is to use a external compressor like Pkzip.exe on both sides with zero compression (pkzip -e0) and check the CRC32 with pkzip -v. If the CRCs match, the files are equal.Third-party products like this one are the responsibility of their manufacturers.
Particularities of fc in FreeDOS
The fc version in FreeDOS It expands the range of options and presents several nuances. In addition to the classic switches (/A, /B, /C, /L, /N, /T, /U, /W), incorporates others such as:
- /LBn: Sets the maximum number of different consecutive ASCII lines in n.
- /Mn: difference limit in binary en n bytes (default 20, with /M0 for unlimited). Use /M without number is equivalent to /M0.
- /Q: does not show the detailed list of differences.
- /R: shows a brief final report (always active with /S).
- /S: descends into subdirectories to broaden the scope of the comparison.
- /X: hides context lines in text comparison.
- /nnn: sets the minimum number of consecutive matching lines to resynchronize.
In FreeDOS, fc is aware of long names when the system supports them, and in binary mode displays offsets, hex values, and printable ASCII characters when applicable. By default, it stops binary comparison after 20 differences., unless you use /M0. There is a known limitation: in text mode only the first 32765 lines and the rest are ignored. Exit codes include complete match, differences detected, invalid parameters, file not found, or errors opening..
Passionate writer about the world of bytes and technology in general. I love sharing my knowledge through writing, and that's what I'll do on this blog, show you all the most interesting things about gadgets, software, hardware, tech trends, and more. My goal is to help you navigate the digital world in a simple and entertaining way.

