in Explorer window, Right-Click on first file and select:

then Right-Click on second file and select:

Screencast:

Answer from Rakka Rage on Stack Overflow
🌐
Visual Studio Code
code.visualstudio.com › docs › editing › codebasics
Basic editing
November 3, 2021 - You can start VS Code from the command line with the --diff option to compare two files.
Discussions

Can i open 2 files and see them on the same window to compare?
That's a basic feature. Just do ctrl + shit + p then search something along the lines of "compare files" (I'm not sure of the exact terms and can verify right now). More on reddit.com
🌐 r/vscode
10
2
October 29, 2024
Any way to compare edited version of file with version that is in git?
I am mostly editing .html, .jsp, etc files but I remember the JetBrains tools like PyCharm had margin color coding to show the changes made since the… More on reddit.com
🌐 r/vscode
5
2
December 16, 2022
Comparing files with VSCode
Either right mouse and select for compare and then the other file or from command line code --diff file1 file2 More on reddit.com
🌐 r/vscode
2
1
September 5, 2022
VSCode switches tabs when comparing two files
Never seen it. If you want to investigate if it's an extension causing it, you could try bisect. More on reddit.com
🌐 r/vscode
6
1
August 4, 2024
🌐
Grant Winney
grantwinney.com › all posts › comparing files in vs code
Comparing files in VS Code | Grant Winney
October 11, 2025 - Open the “Explorer” pane on the left, then press the “…” item in the top corner and select “Open Editors”. Select both files, right click, and choose “Compare Selected” from the context menu:
🌐
Graphite
graphite.com › guides › how-to-compare-two-files-in-vscode
How to compare two files in Visual Studio Code
Right-click on the second file you wish to compare it to and choose 'Compare with Selected' from the context menu. VS Code will open a new tab showing both files side-by-side, highlighting the differences: Added lines are indicated with a green ...
🌐
Alphr
alphr.com › home › how to compare 2 files in vs code
How To Compare 2 Files in VS Code
November 21, 2023 - All you need to do is find the merge icon on your toolbar and click it to merge the two files together. Tucked away inside Visual Studio Code is a powerful difference viewer that lets users compare two versions of the same file or two entirely ...
Find elsewhere
🌐
Visual Studio Code
code.visualstudio.com › docs › getstarted › userinterface
User interface
1 week ago - Hold Ctrl (Cmd on macOS) and select individual files, or hold Shift to select a range of files. If you select two items, you can now also use the context menu Compare Selected command to quickly diff two files.
🌐
SemanticDiff
semanticdiff.com › blog › visual-studio-code-compare-files
Comparing Files in Visual Studio Code
March 10, 2023 - Tip: You can open the diff viewer directly from the command line. Just execute the following command (replace the paths with the two files you want to compare):
🌐
VSCode.one
vscode.one › diff-vscode
How to do a Diff in VS Code (Compare Files)
If you would like to compare your local file changes with the latest git version of a file, click the git icon in the activity bar, then select the file that you would like to compare.
🌐
Draftable
draftable.com › home › blog › how to compare code in visual studio code: best practice
How to Compare Code in VS code. Guide to Compare text, code
January 15, 2025 - You can view the history of a file, compare different versions, and even understand the context of each change through commit messages and author details. See old and new code side by side. It's like comparing two documents, but with smart highlighting of differences.
🌐
Commands.dev
commands.dev › workflows › compare_two_files_in_vs_code
Compare two files in VS Code
Commands.dev is a searchable, templated catalog of popular terminal commands curated from across the internet.
🌐
Microsoft
devblogs.microsoft.com › dev blogs › visual studio blog › new in visual studio: compare files with solution explorer
New in Visual Studio: Compare Files with Solution Explorer - Visual Studio Blog
August 21, 2023 - Hold down the Ctrl key and select two files in the Solution Explorer that you want to compare. After selecting the files, right-click and choose “Compare Selected” from the context menu.
🌐
Web and Wordpress Development Company
websensepro.com › home › how to do a diff in vs code (compare files)
How To Do A Diff in VS Code (Compare Files) - WebSensePro
December 4, 2023 - To begin, open Visual Studio Code and access the Explorer. You can do this by clicking on the Explorer button or using the shortcut Command + Shift + E. Next, open the folder containing the code files you want to compare.
🌐
Visual Studio Marketplace
marketplace.visualstudio.com › items
Compare Folders - Visual Studio Marketplace
Extension for Visual Studio Code - Compare folders by contents, present the files that have differences and display the diffs side by side
🌐
WEBPEAK
webpeak.org › blog › vs-code-compare-two-files
Vs Code Compare Two Files | Web Peak
November 20, 2025 - Yes—create and compare temporary files or use clipboard diff extensions. No, VS Code only displays text differences. Use external tools for binary diffing. Yes, you can copy chunks of code between diff panes, but automatic merging requires Git-based tools or extensions. You can only view two files per diff panel, but you can open multiple diff sessions in separate tabs.
🌐
Visual Studio Code
code.visualstudio.com › docs › sourcecontrol › overview
Source Control in VS Code
November 3, 2021 - Diff editor: side-by-side file comparisons for effective change review
🌐
YouTube
youtube.com › watch
How to Compare Files In VSCode - YouTube
In this Visual Studio Code tutorial, learn how to use compare or diff multiple files using a couple different methods#vscode #editing #coding
Published   October 9, 2024
🌐
YouTube
youtube.com › visual studio code
Diff files in VS Code - YouTube
AboutPressCopyrightContact usCreatorsAdvertiseDevelopersTermsPrivacyPolicy & SafetyHow YouTube worksTest new features · © 2025 Google LLC
Published   September 7, 2023
Views   37K
🌐
Visual Studio Marketplace
marketplace.visualstudio.com › items
Select Compare Tabs - Visual Studio Marketplace
August 18, 2023 - Extension for Visual Studio Code - Adds select compare options to tabs in the editor for quicker access to diff functionality as well as ability to swap files in diff editor.