How to Compare Two Text Files in Notepad

Windows Notepad has no compare feature. Learn how to compare two text files with Notepad++, the fc command or PowerShell, and how to ignore whitespace, case and line-ending differences.

Windows Notepad is a plain-text editor. It does not include a built-in feature for comparing two files. To find what changed between two Notepad files, you can use one of three approaches: view them side by side, use a compare plugin in Notepad++, or run a command-line comparison that Windows already includes. This guide explains what each approach actually compares, how to stop formatting-only differences from cluttering the results, and how to choose the right approach for your situation.

About the evidence: the commands and options described here come from the general documentation for each tool. This guide does not include output observed from a specific Windows build or plugin version, so examples are labeled illustrative. Menu names and option labels can differ between versions. Check your installed version before you rely on a specific setting.

What a text comparison actually checks

A comparison does not change either file. It reads both files, lines them up, and reports lines that were added, removed or changed. Most tools compare line by line. A single changed character marks the whole line as different, and some tools also highlight the exact characters within that line.

A plain-text comparison checks the stored characters, not how the text looks on screen. Two files can look identical in Notepad and still differ in ways a comparison will report:

  • Line endings: Windows usually saves lines with CRLF (carriage return plus line feed), while files from macOS or Linux often use LF only.
  • Trailing spaces and tabs: invisible at the end of a line, but stored as characters.
  • Tabs versus spaces: an indent can look the same either way but is stored differently.
  • Letter case: "Total" and "total" are different characters.
  • Encoding and byte order mark: the same words saved as UTF-8, UTF-8 with BOM, or UTF-16 produce different bytes.
  • Look-alike characters: a non-breaking space, a curly quote or a Unicode letter that resembles a Latin letter differs from its plain counterpart.

When you only care about wording, these formatting differences are noise. The "ignore" options covered below tell a tool to treat some of them as equal. No single option covers all of them. Encoding and look-alike characters usually have to be normalized before you compare.

Which comparison method fits your task

Method | What you need | How differences are shown | Formatting you can ignore | Best for
Side by side in Notepad | Nothing extra | You spot them by eye | None; you judge visually | Very short files or a quick glance
Notepad++ with a compare plugin | Notepad++ and a plugin installed through its plugin manager | Both files side by side with changed lines highlighted | Depends on the plugin; options for spaces, case and empty lines are common | Editing files while you review changes
fc.exe in Command Prompt | Built into Windows | Text listing of mismatched line blocks | Case (/c) and runs of spaces or tabs (/w) | Quick checks without installing anything
PowerShell Compare-Object | Built into Windows | Lines marked as present in one file or the other | Case is ignored by default; whitespace needs pre-processing | Scripting, or checking which lines exist in only one file

Pick the method by goal. To read and fix differences visually, use a side-by-side tool such as a Notepad++ compare plugin. To get a yes-or-no answer or a short report without installing software, use fc.exe. To filter, count or export differing lines, use PowerShell. Side-by-side viewing in plain Notepad is practical only for files short enough to check line by line.

Option 1: View the files side by side in Notepad

  • Open the first file in Notepad, then open the second file in a separate window.
  • Snap one window to each half of the screen, for example by dragging each window to a screen edge or by pressing the Windows key with the left or right arrow.
  • Scroll both files to the same point and read them line by line.
  • To check whether a phrase from one file exists in the other, press Ctrl+F in the other window and search for it.

This method has real limits. The two windows do not scroll together, and nothing highlights the changes. Invisible differences such as trailing spaces or line endings cannot be seen this way. Treat it as a quick look, not a reliable check.

Option 2: Compare files in Notepad++ with a plugin

Notepad++ is a separate free editor. People often call it Notepad, but it is a different program. Its compare features come from community plugins, such as Compare and its fork ComparePlus, not from the core editor. The general workflow is:

  • Open the Plugins menu and choose Plugins Admin.
  • Search the available plugins for a compare plugin, select it and install it. Notepad++ restarts to finish the installation.
  • Open both files in Notepad++.
  • In the Plugins menu, open the compare plugin's submenu and set the first file as the base or first file, if your version asks for this.
  • Switch to the second file and choose Compare. The files appear side by side, with added, removed and changed lines highlighted.
  • Use the plugin's next and previous difference commands to step through the changes.

To ignore formatting differences, look in the plugin's submenu or settings for options such as ignoring spaces, ignoring case or ignoring empty lines. The available options and their names depend on the plugin and its version, so confirm what your copy offers. Because the files stay open in the editor, you can fix a difference immediately and run the comparison again.

Option 3: Compare files with fc.exe in Command Prompt

Windows includes a File Compare command, fc. Open Command Prompt in the folder that holds both files and run a command like this:

fc /n old.txt new.txt

The /n switch adds line numbers to the report. To reduce formatting noise, add more switches:

  • /c ignores differences in letter case.
  • /w compresses runs of spaces and tabs for the comparison, so a different amount of white space does not count as a change.
  • /l forces a text (ASCII) comparison.
  • /u compares the files as Unicode text.
fc /n /c /w old.txt new.txt

If no differences are found, fc says so. Otherwise it lists each block of lines that does not match, labeled with the file name. In PowerShell, fc is an alias for a different command, so type fc.exe in full when you work there. fc does not hide line-ending or encoding differences, so normalize those first, as described below.

Option 4: Compare files with PowerShell

PowerShell can read both files and report which lines appear in only one of them:

Compare-Object (Get-Content old.txt) (Get-Content new.txt)

Each result line carries a side indicator. The arrow <= marks a line found only in the first file, and => marks a line found only in the second file. Because Get-Content splits the files into lines, CRLF and LF endings do not count as differences here. Compare-Object ignores case unless you add -CaseSensitive. It tells you which lines differ but does not give a positional, line-numbered view like a side-by-side tool. Lines that moved can appear as removed and added.

To ignore leading and trailing spaces, trim each line before comparing:

Compare-Object (Get-Content old.txt | ForEach-Object { $_.Trim() }) (Get-Content new.txt | ForEach-Object { $_.Trim() })

How ignore settings change the result (illustrative)

Suppose old.txt contains the line "Invoice total: 120" and new.txt contains "invoice total: 120 ", with a lowercase first letter, two spaces in the middle and a trailing space. The outcomes below follow from each tool's documented behavior. They were not observed in a test run.

  • A strict comparison reports the line as changed.
  • Ignoring case alone still reports it, because of the spacing.
  • Ignoring case and compressing white space should treat the lines as matching, although some tools handle trailing spaces differently from spaces in the middle of a line.
  • If only the number changed, for example 120 to 125, every method still reports the line, because that is a change in content.

Normalize formatting before you compare

Some differences have no reliable ignore switch, so remove them before you compare:

  • Encoding: open each file in Notepad, choose Save As and save both with the same encoding, such as UTF-8. Recent versions of Notepad show the current encoding in the status bar.
  • Line endings: recent versions of Notepad also show the line-ending type in the status bar. In Notepad++, the Edit menu's EOL Conversion option converts a file to a single style.
  • Look-alike characters: replace curly quotes, non-breaking spaces or styled Unicode letters with plain characters. Use find-and-replace, or retype the affected text.
  • Work on copies, not the originals, so the normalization step cannot change your source files.

Will the results be accurate and safe to use?

A comparison is only as reliable as the settings you choose. Every ignore option makes a tool treat some real differences as equal. For code, configuration files, data imports or legal text, a change in spacing or case can matter. Run a strict comparison as well before you sign off on the files as identical.

Readability varies by method. Side-by-side highlighting depends on color, which can be hard to see for some users. fc.exe and Compare-Object produce plain-text reports that you can copy, save, or read with a screen reader. This guide has not tested any specific assistive technology with these tools. If accessibility matters, check the output with the tools your readers actually use.

Online diff websites are another option, but pasting text into one sends it to an external service. Avoid this for passwords, personal data, contracts or internal code. The tools covered here run locally on your computer: fc.exe, PowerShell, and Notepad++ once the plugin is installed. They are the safer choice for sensitive files.