Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Compare & AnalyzeNew to Visual Studio Code? Get it now.
Compare & Analyze

Compare & Analyze

rizkura96

|
26 installs
| (6) | Free
Compare Excel, CSV, PDF, JSON, XML, images, archives and folders right inside VS Code. Start with a free one-month license.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Compare & Analyze for VS Code

See exactly what changed between two files, without leaving VS Code. Every difference is highlighted side by side.

Two Excel files compared cell by cell

Your first month is free. Comparing needs a license key; installing the extension costs nothing. Run Compare & Analyze: Get a Free License (Command Palette, Ctrl+Shift+P), tell me a little about how you plan to use it, and I email you a free key.

What you can compare

  • Excel and CSV: cell by cell, so one changed number in a big sheet is easy to spot.
  • Text, JSON, XML, HTML and Markdown: line by line, with the changed words marked.
  • PDF and images: side by side, with the differences outlined.
  • .zip, .7z, .rar files and whole folders: which files differ, then click one to see its changes.

Two folders compared file by file

With Git or without

It works on any file, in a Git project or not.

  • Not in Git: pick any two files or folders, from anywhere on your disk (steps below).
  • In Git: right-click a file in the Explorer and choose Compare & Analyze: Compare with HEAD to see what you changed since the last commit. No second file to pick. For older versions, choose Compare Commits… or Compare with… and a branch or tag.

The Compare & Analyze panel

Click the Compare & Analyze icon in the Activity Bar (the left edge of VS Code). Everything is in one place, no Command Palette needed:

The Compare & Analyze panel: the actions, the history of all branches each in its own colour, and the right-click menu of a commit

  • Compare: the ways to compare the file you have open, one click each: Select for Compare, Compare with…, Compare with HEAD, Compare with Clipboard and Open Two Files….
  • Git History: a bonus under the actions, to look at the changes of the past. See Bonus: the history behind a change.

Drag and drop: the Compare list is also a section at the bottom of the Explorer, called Compare & Analyze. Drag a file or folder from the Explorer onto it: the first one is marked, and the next one you drop is compared with it. Drag two at once and they are compared right away.

Quick start

  1. Install it: in the Extensions panel (Ctrl+Shift+X) search for Compare & Analyze, check the publisher is rizkura96, click Install.
  2. Get your key: run Compare & Analyze: Get a Free License, then Compare & Analyze: Enter License Key and paste it. A short Get Started page opens the first time and walks you through this.
  3. Compare: right-click a file in the Explorer and choose Compare & Analyze: Select for Compare, then right-click another file and choose Compare & Analyze: Compare with Selected.

(The Command Palette opens with Ctrl+Shift+P, or Cmd+Shift+P on a Mac. Type a few letters of a command and press Enter.)

Ways to compare

Two files or two folders

After Select for Compare, a small A marks the file in the Explorer and the status bar reminds you which file is waiting. Right-click the other file and choose Compare with Selected. Changed your mind? Click the status bar item, or run Clear Selected File.

One file against anything: Compare with…

Right-click a file and choose Compare & Analyze: Compare with…. One list lets you pick the other side:

  • a file you have open, Files in this project… (type part of a name), or Choose another file… from anywhere on your disk,
  • A branch or tag… (inside a Git repository), including remote branches,
  • The clipboard, to check text you copied.

To compare just a few lines against the clipboard, select them in the editor, right-click and choose Compare & Analyze: Compare with Clipboard.

Two files you have not opened in VS Code

Run Compare & Analyze: Open. A picker opens in the tab: choose the two files there, then compare. Back returns to the picker for the next pair. You can also drag files into the boxes from your desktop: hold Shift while you let go, otherwise VS Code opens the file as a tab instead. (Files from the Explorer inside VS Code cannot be dropped into those boxes: drop them on the Compare & Analyze section of the Explorer, or choose Choose from this project in a box's menu.) Try a sample in the same picker loads a ready pair of files, so you can see how a comparison looks.

A changed file in Git

Click it in the Source Control list. Excel, PDF, pictures and archives open here automatically; for any other file, right-click it and choose Compare & Analyze: Compare with HEAD. You see your last commit (committed) against what is on your disk (local). To change what a click opens, search the Settings for Open Changes Here.

A file's history

Right-click a file and choose Compare & Analyze: Compare Commits…. The comparison opens at once on what the file's newest commit changed.

Above the result, ‹ and › step through the history one commit at a time, and the two lists (each commit with who made it and when) let you jump straight to any commit on either side, as often as you like, so you can find when something changed without starting over. A side only offers the commits that keep the older one on the left. To compare with your own file instead, use Compare with HEAD.

Put a change back

In a text file compared with its last commit (or a branch or tag), a small arrow between the two boxes sits beside each changed line.

A text file against its last commit, an arrow beside each change

  • Click the arrow to put the committed line back. Nothing is written yet: the restores are a draft kept in the page, like an editor, and a bar above the result says how many are not saved. Undo (Ctrl+Z), Redo (Ctrl+Shift+Z) and Discard walk through them or give them up, and Save (Ctrl+S) writes the file.
  • Shift+click the arrow to put back the whole block of changed lines at once. That is one step to undo, too.
  • Every changed line has its own arrow, also a run of added lines.
  • Open in editor appears under the right box once you click a line: it opens your file at that line.

If the file changed since you compared, Save writes nothing and says so: compare again. The draft is lost when the comparison is replaced (another commit, Swap).

Bonus: the history behind a change

Compare & Analyze is not a Git client. This part is only here to help you analyze what changed, now and in the past, next to the comparison.

  • Git History: the commits of a branch, straight from Git. In the panel it sits under the actions (and, collapsed, in Source Control and the Explorer). Two lists at the top say what you are looking at: the branch (a local or remote branch, or a tag) and what to show (the whole branch, the open file or a folder). For a file or folder, click a commit to compare it with the commit before; for the whole branch, open a commit to see its files and click one. Commits are grouped by day, so each one shows only its time. The gear chooses what each commit shows: author, time, hash, branches and tags, and the graph (tick what you want, then press OK). Right-click a commit or a file for the other comparisons (with your file as it is now, the latest commit, another commit), or to copy the hash or the whole commit message.

  • Branches in colour: the branch button takes one branch, several (develop + production) or All branches, and each branch gets its own colour, as many colours as there are branches, so you can tell their commits and lines apart (a remote branch has the colour of its local one; tags stay plain). A row of names above the list is the key: click one to keep its commits in full and fade the rest. When your branch is behind its remote, the commits you have not pulled are marked in the list, counted at the top, with a Pull button beside the count. The Fetch button next to the branch is always there to ask the remote for news.

  • Filter: the funnel button opens a strip with message, author, tag, file and date, which filters when you press OK (click it again to hide it; it is closed to begin with). The tag and the file take part of a name (2.2646, prep1.sql), in any case; the dates are whole days. Each filter shows as a chip you can remove.

  • Change the branch from a commit: right-click a commit to Reset Branch to This Commit (soft, mixed or hard; a hard reset says how many commits and files are lost and asks again), Revert This Commit, Cherry-pick This Commit, Tag This Commit, Create Branch from This Commit or Delete a Tag of This Commit. The branch list (the branch box of the Git History) has branches only, the ones on your computer and the ones on the remote, no tags. Right-click a branch for Pull, Fetch, Switch to, New branch from, Rename, Open in its own folder, Merge into the branch you are on, Rebase onto, Delete (on the remote for a remote branch, asking first) and Undo last commit; the questions are asked in the page. Ctrl+A in the list chooses every branch, and Pull in the menu then pulls every chosen branch that is on your computer; a branch that is only on the remote is left out, and the notice says so (it is already the latest there is). A revert or cherry-pick that meets conflicts is taken back whole, so the branch is never left half way. After a reset the remote branch may be ahead, so a Force Push is offered (with a lease, so work pushed by someone else meanwhile is not lost).

  • Several folders of one project in a window: when the window holds more than one folder with the same project (the repository and its worktrees, or a copy of it), the Changes list has a section for each folder, all open at once, with its own Staged and Unstaged one level in: the folder's name, its branch, how many files are changed and how many are staged. A header only folds its own section, so there is nothing to switch. The line at the top says what is true now: with changes in one folder only it says that folder's branch (On pr-production in the-folder), with changes in more it names them (2 folders), and then pointing at (or clicking) the summary of the changes opens a box over the list with a row for each folder, its branch and how many files of each kind; a click on a row goes to its section. Stage, unstage, discard, stash and the parts of a file work in the folder of the section they are in. The buttons of the top are for every folder: Commit makes a commit in each folder that has something staged, with the one message you wrote and each on its own branch (two commits, one per branch, the same message; it asks first and names the folders), Commit & Push pushes each too, Push pushes each folder's own branch, Pull pulls the folders that are behind and Fetch asks every remote. A folder that fails does not stop the others, and the line at the end says how each went. The Git History follows the file you are editing, and with more than one folder it says which folder it is of (You are on pr-production in the-folder); in its branch list a branch that another folder has checked out says open in that folder, and Switch, Delete and Open in its own folder are off for it (git does not allow them); Pull, Merge, Rebase, New branch from it, Rename and the rest still work, and Pull updates it in its own folder. With one folder nothing of this shows. In the ⋯ pages, with more than one folder, Stashes are told by the branch they were made on (with the folder that has it; a stash belongs to the repository, so Apply and Pop put it back in the folder you are in, and the page says which) and Recent moves have a list for each folder (HEAD is a folder's own), and what you do with a move is done in its folder.

  • The ⋯ panel of the Changes page: Undo last commit (the commit leaves the branch, its changes stay staged with its message ready; it says when the commit is on the remote already). Branches show how far each is from its remote (↑2 to push, ↓3 to pull, local when it is only here, gone when its remote branch was deleted); point at one for its buttons: switch, merge into the branch you are on, rebase the branch you are on onto it (taken back whole on conflicts; a force push is offered after, as it changes pushed commits), delete. Stashes open to the files they hold before you apply, pop or drop them. Recent moves lists where HEAD has been (the reflog): after a reset or a wrong switch, make a branch at the commit you lost or move back to it.

  • Smaller things: Stash some of it: the Stash button in the header of the Staged and Unstaged groups (it acts on the chosen files, or on all of the group), and the stash button of a file or folder row, ask for a note in the page and put only those aside; the Staged group's button takes only what is staged (Git 2.35 or newer), the Unstaged one takes those files as they are in your files, and a new file (shown U, untracked: Git does not know it yet) goes with it. The ⋯ panel's Stash still puts everything aside. Pull requests (the Pull requests row of the ⋯ panel, one click) open a tab of our own, on GitHub and Azure DevOps, with no web page and no Command Palette: Open lists the open ones (a click opens one), New is a form that fills the tab: any branch From and any branch Into, a title and a description made from the commits, and beside it what the pull request would be: nothing to merge when the target already has every commit (the button stays off), ready with how many commits go in, or conflicting with the files named and Resolve conflicts here…, which merges the target into the source and leaves the conflicts to the Changes list, where you take the source's version (Keep mine) or keep the target's (Take remote) for chosen files or folders, or for all; the push of the branch is offered when the remote lacks some of it. An opened pull request shows its description, who approved or asked for changes, the conversation in threads (a comment on a file says which and where), and the files it changes (a click compares one in the editor); from there approve, request changes (Azure: Wait for Author), reject (Azure), comment, merge or complete, close, check out its branch, or open it in the browser; each change asks first, in the page. The sign-in is VS Code's own account (Microsoft for Azure DevOps, GitHub for GitHub), asked once, and the token is never kept by the extension. When the sign-in or the hosting says no, the page that makes the pull request opens in the browser, filled in. The tab is known in the sidebar: while the pull requests tab is open, the Pull requests row of the ⋯ panel says so (a green open mark) and has a close button; clicking the row brings the tab forward, and closing the tab by hand or from the row both put the row back as it was. Opening it from the ⋯ panel shows no waiting overlay. The version is one hover away: point at Compare & Analyze in the status bar (bottom right) and the tooltip starts with the extension's version and when it was built; a click still shows the license. Long messages are short: every notice of the extension goes through one place; one that would not fit a toast (which ends it in …) is cut at a sentence and the whole of it is behind a Details button. A new file is opened, not compared: a click on a file Git does not know yet (or one that is new and staged) opens it, as text, in a viewer or with its program, since there is nothing to compare it with; a new file of a pull request compares with an empty file of its own kind (an empty workbook for Excel). A pull request is about the remote: it lists the branches the remote has (and a local one the remote lacks, which is pushed first), compares them as the remote has them, and pending changes of yours never get in the way; only Resolve conflicts here… needs a clean working copy, and asks, in the page, whether to put your pending changes in the stash first. Quick to come back to: what was read (the list, the branches, a pair compared, an opened pull request) is kept for a couple of minutes, so going between Open and New shows it at once; the list and an opened pull request are looked at again quietly behind it, and the ↻ button reads everything again. Pull request notices: every few minutes (compareanalyze.pullRequests.checkMinutes, and compareanalyze.pullRequests.notify turns it off) the open pull requests are read with the account you are signed in with, and a notice tells you when one waits for your review (you are asked and have not voted) or, on Azure DevOps, when one of yours is approved by all its reviewers and can be completed; the count stays in the status bar (a click opens the list), and each thing is told once. It never asks you to sign in, and it only reads. Questions of an action (reset, rebase, delete a branch, discard, tag name, and the rest) are asked in the page itself, in a box at the top, not in a pop-up of the editor. The Changes list reads the files again when a file changes (by any program, Excel included, and under a synced folder such as OneDrive), when the window comes back to the front, and with the ↻ button in its header. Edit Commits from Here… (on a commit) opens the commits from it to the newest to be arranged: keep, reword (type the new message in its row), squash or fixup into the one before, drop, and move them with the arrows; Rebase makes them again as arranged (no editor opens). A merge in between refuses it, two commits changing the same lines take the whole rebase back, and a force push is offered when some of them were on the remote. Parts of a file (the button on a changed file in the Changes list): the file opens into its hunks, each with what it adds and removes; stage, unstage or discard one alone. The hunks are read again whenever the list changes, and a part is applied only when it is still the one that was shown. Worktrees (in the ⋯ panel, and a button on each branch): a branch checked out in a folder of its own beside the repository, so you do not switch away from the one in hand and two branches (say develop and production) never share a folder. Add to this window puts the folder next to the first in one window; Open in a window of its own is the other way. Removing a worktree keeps its branch. The history filter has a Code field (the text of the changes): it lists the commits that added or removed that text, so who brought this word in, and when is one search. Resolve in Merge Editor (the button on a file in the Conflicts list, or its right-click) opens VS Code's merge editor, so a conflict is settled line by line, taking a part of each side. Squash This and Newer Commits… (on a commit) turns that commit and every newer one into one: their changes stay staged, the message is ready (the oldest subject, the others listed) and you commit it; it refuses when a merge lies in between and says when some of them are on the remote (a force push is needed then). Cherry-pick Without Committing… (on a commit) copies its changes into your files, staged, with its message ready. Add to .gitignore and Ignore All Files of This Kind (right-click a file or folder that is not tracked yet). Who Changed This Line (right-click in the editor) names the author, the time and the commit of the line, and copies its hash. Stage Selected Lines and Unstage Selected Lines (right-click a selection in the editor) are the Git extension's own, offered beside the compare commands. A tag you make offers Push Tag, and deleting one asks whether it goes from the remote too.

  • Put an old commit back as a new commit: right-click a commit for Restore Files from This Commit… (choose files and folders in the tree) or Restore All Files from This Commit… (every file that commit changed), and the same two with Before This Commit (the files as they were before it); Restore Everything as of This Commit… puts the whole project back. A single file has Restore File from This Commit and Restore File from Before This Commit too. In every menu a commit is called This Commit, the one it was made on top of Before This Commit, and files are taken from a commit. The files come back staged, the commit message is already written, and committing them gives a new commit on top, so nothing is rewritten and it pushes without force.

  • In a tab: Open Git History in a Tab gives a bigger view, with the filter (message, author, tag, file and date, one click on the funnel), a branch list, and the files of the commit you pick. Everything the sidebar does works here too (the same right-click menus, a compare opening as a tab of its own); the sidebar is just the compact version.

  • Where the Git History is: in the sidebar, under Changes. It is yours to move: drag its title to the bottom (beside the Terminal and the Problems, as wide as a tab) or anywhere else, and its bar fits the place (in a narrow one the branch box has a row of its own, in a wide one the branch box, the scope and the buttons are on one line). Show in history view (in the tab) puts the same history in that view wherever it is.

  • The files of a commit as a tree: the gear above the list has Files as a tree: the files under a commit (in the sidebar and in the tab) are shown in their folders, which close and open with a click, instead of one flat list. It is remembered per place.

    The Git History tab: all branches in colour, the commits not pulled yet marked, and the files of the commit you pick

    Click a file to compare it with the previous commit; right-click it to compare with your own file instead, open it, save an old version or copy its path. Nothing sits over the file names.

  • Save an old version: Save… on a file keeps it as that commit had it, or as the commit before had it, for an archive or to compare by hand in the web app. The name carries the day and the short hash, so versions stay apart even on the same day: Report_2025-11-14_811bc52.xlsx. Right-click a commit of the whole branch (or of a folder) to save all the files it changed, or choose them: tick files, or a folder to take everything in it, and they are saved under a folder named for the commit, each file keeping its path.

    Choose Files to Save: the files of a commit as a tree with tick boxes

  • Pull, without the refusals: when the branch follows a remote one, the Pull (n) button beside Push on the Changes page pulls what is new, n counting the commits not pulled yet, and the bar above the history says how many they are and has its own Pull button, which is there only while something is not pulled; Fetch is the cloud button beside it (not the circular arrow of the header, which only reads your files again), with a green dot while Auto-fetch is on, and the Auto-fetch box is beside Amend, under the commit message; the pull works with the edits you have not committed set aside and put back, so it works even when the new commits touch a file you are editing. If the same lines changed, nothing is lost: choose per file to compare the two versions, keep yours or take the remote's (a workbook can also keep both). Tick Auto-fetch to have the remote asked every few minutes; it only fetches. Push and rebase stay in Source Control.

  • Changes (a bonus, so the day's git can stay in one place): a list of what is staged and what is not, under the actions. A line under the commit box counts the files by kind (modified, new, deleted, renamed) in the colour of their letter. Point at a row and its buttons show at the right (open the file, discard, stage or unstage), so no right-click is needed, though the right-click menu is still there. A workbook or a PDF is not text: Open File shows it in a viewer extension when one is installed, and otherwise says what to install (or opens it with the program the computer uses for it). Each file has an icon of its kind (workbook, SQL script, picture, ...) and the page fills the sidebar edge to edge, as Source Control does. Tick the boxes of the files (or a folder, or a whole group) and press Stage (n), Unstage (n) or Discard (n) in the group's header, or use Stage all and Unstage all; a file renamed on disk is one row marked R; a right-click on a chosen file acts on every chosen file; the ⋯ button opens a panel in the page to put edits aside in a stash, then apply, pop or drop it (branches are made, switched, renamed and deleted from the right-click menu of the Git History's branch list), and Merge (from that menu) brings a branch into the one you are on (when both changed the same lines the merge stops: the Conflicts list takes a box per file, Keep mine or Take remote for the chosen or all of them finishes the merge, and Abort merge gives it up); Discard (right-click, or Discard all) asks first and names the files, and says when a file that is not tracked yet would be deleted. Write the message and press Commit (Ctrl+Enter); with nothing staged it asks whether to stage everything, Amend replaces the last commit, and Push (it counts the commits, and publishes a branch that is not on the remote yet) sends them. The arrow beside Commit offers Commit & Push (Ctrl+Shift+Enter) for when a commit is not to wait for others; after a plain commit the notice says how many commits are not pushed yet, with a Push button, and the icon in the Activity Bar carries that count. A click on a file opens it in the comparison, so a changed workbook or PDF reads as a comparison, not as bytes. VS Code's own Source Control keeps working beside it: both read the same repository.

  • Switch branch, and pull more than one: a line above the list always says which branch you are on, with how far it is from its remote (↓2 ↑1); it turns amber when the list shows the history of another branch, so you never mistake one for the other. In the branch list, point at a branch for Switch (a remote branch that is not on your machine yet is made here, following it) and, when the remote has something new, Pull; Fetch at the foot asks every remote for news, and Pull ticked brings every ticked branch up to date: the one you are on as above, another local branch moved forward without leaving yours. A branch that is only on the remote is not pulled: you are told to switch to it first, with a button that does it. A switch that would overwrite an edit of yours is refused with the files named, and nothing is lost. Switch Branch… in the Command Palette does the same from a list.

Little things that help

  • Swap: for two plain files, a button above the result puts them the other way round.
  • Your view is remembered: word wrap, zoom, inline view and the grid options stay as you left them for the next comparison.
  • Big text files: two text files that together are more than the server reads at once (about 28 MB, for instance a large SQL script) are not refused: they open in VS Code's own comparison, with a line saying why. Workbooks, tables, PDFs and pictures that big still need smaller files.
  • One tab: turn on the setting Compare & Analyze: Reuse Panel to open each comparison in the same tab instead of a new one.
  • License in the status bar: it shows when your key ends and turns yellow in the last week. Click it for details.
  • Report a Problem: run Compare & Analyze: Report a Problem. Your version details are copied, and the Contact page opens.

Your license, updates and privacy

  • License: the first month is free. Before it ends I will write to you; continuing after that is a paid license, and you decide then. Compare & Analyze: Show License tells you when your key ends.
  • Updates: VS Code updates the extension for you.
  • Privacy: to compare, the two files and your key are sent over a secure connection to the Compare & Analyze server, compared in memory and not stored. That is why the extension needs the internet and a key.

If something does not work

  • "A license key is needed" or "has been withdrawn": run Compare & Analyze: Enter License Key, or Get a Free License if you have none.
  • "The server could not be reached": check your internet connection and try again.
  • Anything else: run Compare & Analyze: Report a Problem, or open View → Output, choose Compare & Analyze, and send me what you see there with the version from Compare & Analyze: Show Version, on the Contact page: https://www.compareanalyze.com/contact
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft