ℹ️ Skipped - page is already crawled
| Filter | Status | Condition | Details |
|---|---|---|---|
| HTTP status | PASS | download_http_code = 200 | HTTP 200 |
| Age cutoff | PASS | download_stamp > now() - 6 MONTH | 0.2 months ago |
| History drop | PASS | isNull(history_drop_reason) | No drop reason |
| Spam/ban | PASS | fh_dont_index != 1 AND ml_spam_score = 0 | ml_spam_score=0 |
| Canonical | PASS | meta_canonical IS NULL OR = '' OR = src_unparsed | Not set |
| Property | Value |
|---|---|
| URL | https://grantwinney.com/how-to-compare-files-using-vs-code/ |
| Last Crawled | 2026-04-12 07:17:07 (6 days ago) |
| First Indexed | 2023-07-27 04:09:38 (2 years ago) |
| HTTP Status Code | 200 |
| Meta Title | Comparing files in VS Code | Grant Winney |
| Meta Description | VS Code is a great editor with a lot of useful features, like being able to compare two random files for differences. Let’s see how. |
| Meta Canonical | null |
| Boilerpipe Text | I recently found myself in need of comparing two versions of an XML file for a merge, something that seems to frequently confuse git. Even better, this particular file was generated as a
minified file
, which
really
confuses git. Fortunately, VS Code helps with formatting
and
comparing files, but let’s stick to comparing.
Files that are saved in the same folder
If the files are saved to disk in the same folder, open the folder, either with the “Open Folder” button on the left (if the “Explorer” pane is open), or with the “Open Folder” option in the “File” menu, or with the “ctrl-k, ctrl-o” shortcut (in Windows):
Then select both files, right click, and choose “Compare Selected”:
We get a nice little side-by-side that collapses into an inline comparison if the window’s too small:
Files that
aren’t
in the same folder.. or aren’t saved at all
Whether your files are saved to disk or not, the first thing you’ll need to do is show all open editors, something that doesn’t seem to be displayed by default and is hidden in the “three dots” menu.
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:
This works just as well for files that aren’t saved too: |
| Markdown | [Grant Winney](https://grantwinney.com/ "Grant Winney (Alt + H)")
- [About](https://grantwinney.com/about/ "Hi! I'm Grant.")
- [Learn](https://grantwinney.com/categories/learn/ "Learn")
- [Explore](https://grantwinney.com/categories/explore/ "Explore")
- [Build](https://grantwinney.com/categories/build/ "Build")
- [Reflect](https://grantwinney.com/categories/reflect/ "Reflect")
# Comparing files in VS Code
Jul 26, 2023 (rev. Oct 11, 2025) · 2 min

Table of Contents
- [Files that are saved in the same folder](https://grantwinney.com/how-to-compare-files-using-vs-code/#files-that-are-saved-in-the-same-folder)
- [Files that *aren’t* in the same folder.. or aren’t saved at all](https://grantwinney.com/how-to-compare-files-using-vs-code/#files-that-aren-in-the-same-folder-or-arent-saved-at-all)
I recently found myself in need of comparing two versions of an XML file for a merge, something that seems to frequently confuse git. Even better, this particular file was generated as a [minified file](https://grantwinney.com/minification-vs-obfuscation/), which *really* confuses git. Fortunately, VS Code helps with formatting *and* comparing files, but let’s stick to comparing.
## Files that are saved in the same folder[\#](https://grantwinney.com/how-to-compare-files-using-vs-code/#files-that-are-saved-in-the-same-folder)
If the files are saved to disk in the same folder, open the folder, either with the “Open Folder” button on the left (if the “Explorer” pane is open), or with the “Open Folder” option in the “File” menu, or with the “ctrl-k, ctrl-o” shortcut (in Windows):
[](https://grantwinney.com/how-to-compare-files-using-vs-code/image-12.png)
Then select both files, right click, and choose “Compare Selected”:
[](https://grantwinney.com/how-to-compare-files-using-vs-code/image-13.png)
We get a nice little side-by-side that collapses into an inline comparison if the window’s too small:
[](https://grantwinney.com/how-to-compare-files-using-vs-code/xmlcompare1.gif)
## Files that *aren’t* in the same folder.. or aren’t saved at all[\#](https://grantwinney.com/how-to-compare-files-using-vs-code/#files-that-aren-in-the-same-folder-or-arent-saved-at-all)
Whether your files are saved to disk or not, the first thing you’ll need to do is show all open editors, something that doesn’t seem to be displayed by default and is hidden in the “three dots” menu.
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:
[](https://grantwinney.com/how-to-compare-files-using-vs-code/image-15.png)
[](https://grantwinney.com/how-to-compare-files-using-vs-code/image-16.png)
[](https://grantwinney.com/how-to-compare-files-using-vs-code/image-17.png)
This works just as well for files that aren’t saved too:
[](https://grantwinney.com/how-to-compare-files-using-vs-code/image-19.png)
[](https://grantwinney.com/how-to-compare-files-using-vs-code/image-18.png)
- [vscode](https://grantwinney.com/tags/vscode/)
Comments
© 2026 [Grant Winney](https://grantwinney.com/read-me/) · Powered by [Hugo](https://gohugo.io/) + [PaperMod](https://github.com/adityatelange/hugo-PaperMod/) · [Archives](https://grantwinney.com/archives) |
| Readable Markdown | I recently found myself in need of comparing two versions of an XML file for a merge, something that seems to frequently confuse git. Even better, this particular file was generated as a [minified file](https://grantwinney.com/minification-vs-obfuscation/), which *really* confuses git. Fortunately, VS Code helps with formatting *and* comparing files, but let’s stick to comparing.
## Files that are saved in the same folder
If the files are saved to disk in the same folder, open the folder, either with the “Open Folder” button on the left (if the “Explorer” pane is open), or with the “Open Folder” option in the “File” menu, or with the “ctrl-k, ctrl-o” shortcut (in Windows):
[](https://grantwinney.com/how-to-compare-files-using-vs-code/image-12.png)
Then select both files, right click, and choose “Compare Selected”:
[](https://grantwinney.com/how-to-compare-files-using-vs-code/image-13.png)
We get a nice little side-by-side that collapses into an inline comparison if the window’s too small:
[](https://grantwinney.com/how-to-compare-files-using-vs-code/xmlcompare1.gif)
## Files that *aren’t* in the same folder.. or aren’t saved at all
Whether your files are saved to disk or not, the first thing you’ll need to do is show all open editors, something that doesn’t seem to be displayed by default and is hidden in the “three dots” menu.
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:
[](https://grantwinney.com/how-to-compare-files-using-vs-code/image-15.png)
[](https://grantwinney.com/how-to-compare-files-using-vs-code/image-16.png)
[](https://grantwinney.com/how-to-compare-files-using-vs-code/image-17.png)
This works just as well for files that aren’t saved too:
[](https://grantwinney.com/how-to-compare-files-using-vs-code/image-19.png)
[](https://grantwinney.com/how-to-compare-files-using-vs-code/image-18.png) |
| Shard | 57 (laksa) |
| Root Hash | 16129441129728297057 |
| Unparsed URL | com,grantwinney!/how-to-compare-files-using-vs-code/ s443 |