Compare two existing files
Compare two files in VS Code when both versions are already on your device. Its built-indiff editor shows literal file changes without a comparison extension.
- Open the folder containing your files in Visual Studio Code.
- In the Explorer, right-click the original file and choose Select for Compare.
- Right-click the updated file and choose Compare with Selected.
- Review the differences in the comparison editor. Check the file titles to confirm which version is on each side.
This comparison is built into VS Code; you do not need an extension for these steps. When reviewing configuration or source code, consider whitespace and line-ending changes as well as visible words.
Compare two pieces of unsaved text
Open the Command Palette and run File: Compare New Untitled Text Files. Paste one version into each editor. This is useful when you have snippets rather than saved files.
Compare with the clipboard or your last saved version
With the file active, open the Command Palette and choose File: Compare Active File with Clipboard to check it against copied text. Choose File: Compare Active File with Saved to review edits made since you last saved. Check the editor titles before interpreting which side is which.
Open a comparison from the command line
If the code command is available, run code --diff original.txt updated.txt. Supply both file paths and put paths containing spaces in quotes. If the command is not recognized, follow the VS Code command-line setup instructions or use the Explorer steps above.
Try the file comparison with known changes
Open the original notes and updated notes. Compare them to find the changed day and budget and the added status line. If the view is too narrow, select More Actions (…) → Diff View and choose Inline or Side by Side. Automatic view chooses a layout for the available width.
When a browser comparison is useful
For a quick text review, paste both versions into TextCompare, select word or character mode, and download a readable report. For file editing, source control history and development workflows, stay in your editor. This website does not apply patches or merge your files.