What happens when restricted stock units vest
A restricted stock unit is a promise of a share. Nothing is taxed while it is only a promise. On the vesting date the shares are delivered, and their value that day becomes wages: it appears on your W-2 next to your salary, and it is taxed as ordinary income, not as an investment gain.
Because it is wages, the employer has to withhold on it, and it does so under the rules for supplemental pay, the same rules that apply to a cash bonus. There is usually no cash to withhold from, so the plan sells some of the new shares to pay the tax. What arrives in your brokerage account is what is left.
Why the flat rate is often not enough
Federal withholding on vested stock is normally the flat supplemental rate, whatever your salary and whatever your W-4 says. For many people with equity awards that rate is below the rate the vesting is actually taxed at, because the value of the shares is stacked on top of a salary that is already in a higher bracket. The withholding looks complete on the day and the gap arrives with the return.
The comparison under the result measures that gap directly: the income tax withheld from the vesting against what the vesting adds to your tax for the year, worked out by running the regular annual calculation with and without it. Where the gap is large, the usual ways to close it during the year are estimated tax payments or an extra amount on the W-4 for the paychecks that remain. Which suits you depends on your year, and this page does not choose for you.
Sell to cover, the shares you keep, and the cash left over
The shares sold to cover the tax pay every line withheld: federal income tax, Social Security and Medicare, the state's income tax and any state levy. Plans normally sell whole shares, so the sale raises a little more than the tax, and the difference is paid to you as cash. That is the convention this page follows. Some plans withhold shares instead of selling them, and a few sell fractions of a share or sell at a price slightly different from the vesting price, so your own statement can differ by a few dollars.
Cost basis, and the Form 1099-B trap
Because the value of the shares at vesting was already taxed as wages, that value is also their cost basis: the starting point for working out a gain or a loss when you sell. If you sell at the vesting price there is no gain at all.
The trap is the form your broker sends. For shares from equity awards the basis on Form 1099-B is often reported as zero or left out, and if you file it as it stands, the whole sale price is taxed a second time as a capital gain. The correction goes on Form 8949, where you enter the right basis and the adjustment. The basis the page shows is the figure to check your paperwork against.
Holding period
How a later sale is taxed depends on how long you held the shares, and that clock starts when they vest, not when the units were granted. Shares sold within a year of vesting give a short-term gain or loss, taxed like wages; after that they are long-term. Shares sold to cover the tax are sold at the vesting price on the vesting date, so they carry no gain to speak of.
Social Security, Medicare and a large vesting
Social Security stops at the wage base for the year, counted per employer, so a vesting early in the year may carry the full rate while the same vesting in December carries none. Additional Medicare starts once one employer has paid you more than a set amount in the year. Both depend on what this employer has already paid you, which is why the page asks for it. A vesting large enough to cross either line in one go is split at the line, and the page shows the result.
What the state takes
States tax vested shares as wages too, each under its own rule for supplemental pay. Some apply a flat supplemental rate, and California applies a higher flat rate to bonuses and stock options than to other supplemental pay. Others add the payment to a regular pay packet and use their normal tables, and states with no income tax on wages take nothing for income tax. The table of states on this page gives each state's rule and links to the document it comes from.