Do I have to pay a capital gains tax if I rebuy different stocks?
"Yes- you do not realize gains or losses until you actually sell the stock.  After you sell the initial stocks/bonds you have realized the gain.  When you buy the new, different stocks you haven't realized anything until you then sell those. There is one exception to this, called the ""Wash-Sale Rule"".  From Investopedia.com: With the wash-sale rule, the IRS disallows a loss deduction from the   sale of a security if a ‘substantially identical security' was purchased within 30 days before or after the sale.  The   wash-sale period is actually 61 days, consisting of the 30 days before   and the 30 days after the date of the sale. For example, if you bought   100 shares of IBM on December 1 and then sold 100 shares of IBM on   December 15 at a loss, the loss deduction would not be allowed.   Similarly, selling IBM on December 15 and then buying it back on   January 10 of the following year does not permit a deduction. The   wash-sale rule is designed to prevent investors from making trades for   the sole purpose of avoiding taxes." Yes. As long as the stock is in a taxable account (i.e. not a tax deferred retirement account) you'll pay gain on the profit regardless of subsequent purchases.  If the sale is a loss, however, you'll risk delaying the claim for the loss if you repurchase identical shares within 30 days of that sale. This is called a wash sale. Probably.  It sounds like you're looking for a 1031-exchange for stocks and bonds.  From the wikipedia page for 1031-exchanges: To qualify for Section 1031 of the Internal Revenue Code, the properties exchanged must be held for productive use in a trade or business or for investment. Stocks, bonds, and other properties are listed as expressly excluded by Section 1031 of the Internal Revenue Code, though securitized properties are not excluded.  1031-exchanges usually are applicable in real estate. Yes (most likely). If you are exchanging investments for cash, you will have to pay tax on that - disregarding capital losses, capital loss carryovers, AGI thresholds, and other special rules (which there is no indication of in your question). You will have to calculate the gain on Schedule D, and report that as income on your 1040. This is the case whether you buy different or same stocks.
You don't generally pay capital gains taxes until you sell the stock. If you bought it in 2013 and the price goes up in 2014 but you just hold on to the stock, you won't have to pay any taxes on it. If you then sold it in 2015 for a profit, you'd have to pay capital gains taxes on the profit. Note that this excludes dividends. Dividends may complicate the matter somewhat. I'm also assuming you are in the U.S. or Canada, or a country like one of those two. It's possible some other country does taxes differently, though it'd surprise me. You don't. When you sell them - your cost basis would be the price of the stock at which you sold the stocks to cover the taxes, and the difference is your regular capital gain. Assuming that taxes were withheld when you received the options, you would now only owe tax on the profit from the sale of the stock.  The cost basis would be whatever you bought the stock for (the strike price of the options in this case), and the profit will be the total amount received from the sale minus the total cost of those shares. Since you bought the stock more than one year ago, you will get taxed at the long-term capital gains rate of 15% (unless you are in the 39.6% tax bracket, in which case the rate is 20%). As with all tax advice on this site, you need to check with a tax specialist when you actually file, but that should give you a rough indication of what your tax liability is. Yes, to change which stocks you owe you need to sell one and buy the other, which for tax purposes means taking the profit or loss accrued up to then. On the other hand this establishes a new baseline, so you will not be double-faced on those gains. It just makes a mess of this year's tax return, and forced you to set aside some if the money to cover that. If you are a US resident (not necessarily citizen) then yes, you do have to pay capital gains taxes on any capital gains, including interest from assets oversees (like interest from a savings account). Additionally you have to report all your foreign bank accounts according to FATCA (https://www.irs.gov/businesses/corporations/foreign-account-tax-compliance-act-fatca). "Generally if you are using FIFO (first in, first out) accounting, you will need to match the transactions based on the number of shares. In your example, at the beginning of day 6, you had two lots of shares, 100 @ 50 and 10 @ 52.  On that day you sold 50 shares, and using FIFO, you sold 50 shares of the first lot.  This leaves you with 50 @ 50 and 10 @ 52, and a taxable capital gain on the 50 shares you sold. Note that commissions incurred buying the shares increase your basis, and commissions incurred selling the shares decrease your proceeds.  So if you spent $10 per trade, your basis on the 100 @ 50 lot was $5010, and the proceeds on your 50 @ 60 sale were $2990.  In this example you sold half of the lot, so your basis for the sale was half of $5010 or $2505, so your capital gain is $2990 - 2505 = $485. The sales you describe are also ""wash sales"", in that you sold stock and bought back an equivalent stock within 30 days.  Generally this is only relevant if one of the sales was at a loss but you will need to account for this in your code.  You can look up the definition of wash sale, it starts to get complex. If you are writing code to handle this in any generic situation you will also have to handle stock splits, spin-offs, mergers, etc. which change the number of shares you own and their cost basis.  I have implemented this myself and I have written about 25-30 custom routines, one for each kind of transaction that I've encountered.  The structure of these deals is limited only by the imagination of investment bankers so I think it is impossible to write a single generic algorithm that handles them all, instead I have a framework that I update each quarter as new transactions occur." "They are similar in the sense that they are transferring money from the company to shareholders, but that's about it. There is different tax treatment, yes, but that's because they are fundamentally different. Dividends transfer money equally to all shareholders, but that also reduces the value of each share by the same amount, since it's cash out the door, which drops the value of the company. Shareholders are taxed on dividends at the capital gains tax rate. A buyback returns the cash to shareholders who decide to sell.  Other shareholders get a secondary benefit of now owning a slightly larger portion of the company since there are fewer shares outstanding.  Shareholders only pay tax if they sell shares for a gain. It that means when company buyback their stock, the stock price will definitely go up? Not necessarily. It depends on the price that the company buys back the shares for and what the ""opportunity cost"" of that cash is - meaning what else could the company have done with the cash that would have been better? Buybacks often happen in mature companies with undervalued stock prices and fewer opportunities for further investment.  If a company has an intrinsic value of $10 a share but its stock is trading at $8 a share, then it can instantly get a 25% ""return"" by buying back stock.  I use the term ""return"" loosely since the company does not actually profit from the buyback, but from the shareholder's perspective the company is worth more per share." @BlackJack does a good answer of addressing the gains and when you are taxed on them and at what kind of rate. Money held in a brokerage account will usually be in a money-market fund, so you would own taxes on the interest it earned.   There is one important consideration that must be understood for capitol Losses.  This is called the Wash Sale Rule.  This rule comes into affect if you sell a stock at a LOSS, and buy shares of the same stock within 30 days (before or after) the sale.  A common tactic used to minimize taxes paid is to 'capture losses' when they occur, since these can be used to offset gains and lower your taxes.  This is normally done by selling a stock in which you have a LOSS, and then either buying another similar stock, or waiting and buying back the stock you sold.   However, if you are intending to buy back the same stock, you must not 'trigger' the Wash Sale Rule or you are forbidden to take the loss. Examples.  Lets presume you own 1000 shares of a stock and it's trading 25% below where you bought it, and you want to capture the loss to use on your taxes. This can be a very important consideration if trading index ETF's  if you have a loss in something like a S&P500 ETF, you would likely incur a wash sale if you sold it and bought a different S&P500 ETF from another company since they are effectively the same thing.  OTOH, if you sold an S&P500 ETF and bought something like a 'viper''total stock market' ETF it should be different enough to not trigger the wash sale rule.  If you are trying to minimize the taxes you pay on stocks, there are basically two rules to follow.  1) When a gain is involved, hold things at least a year before selling, if at all possible.  2) Capture losses when they occur and use to offset gains, but be sure not to trigger the wash sale rule when doing so. Normally, you don't pay capital gains tax until you actually realize a capital gain.  However, there are some exceptions. The exception that affected Eduardo Saverin is the expatriation tax, or exit tax.  If you leave a country and are no longer a tax resident, your former country taxes you on your unrealized capital gains from the period that you were a tax resident of that country.  There are several countries that have an expatriation tax, including the United States.  Saverin left the U.S. before the Facebook IPO. Saverin was perhaps already planning on leaving the U.S. (he is originally from Brazil and has investments in Asia), so leaving before the IPO limited the amount of capital gains tax he had to pay upon his exit.  (Source: Wall Street Journal: So How Much Did He Really Save?) Another situation that might be considered an exception and affects a lot of us is capital gain distributions inside a mutual fund.  When mutual fund managers sell investments inside the fund and realize gains, they have to distribute those gains among all the mutual fund investors.  This often takes the form of additional shares of the mutual fund that you are given, and you have to pay capital gains tax on these distributions.  As a result, you can invest in a mutual fund, leave your money there and not sell, but have to pay capital gains tax anyway.  In fact, you could owe capital gains tax on the distributions even if the value of your mutual fund investment has gone down. You should get a 1099-MISC for the $5000 you got.  And your broker should send you a 1099-B for the $5500 sale of Google stock. These are two totally separate things as far as the US IRS is concerned. 1) You made $5000 in wages. You will pay income tax on this as well as FICA and other state and local taxes. 2) You will report that you paid $5000 for stock, and sold it for $5500 without holding it for one year. Since this was short term, you will pay tax on the $500 in income you made. These numbers will go on different parts of your tax form.  Essentially in your case, you'll have to pay regular income tax rates on the whole $5500, but that's only because short term capital gains are treated as income.  There's always the possibility that could change (unlikely).  It also helps to think of them separately because if you held the stock for a year, you would pay different tax on that $500.  Regardless, you report them in different ways on your taxes. What you are looking for is a 1031 exchange. https://www.irs.gov/uac/like-kind-exchanges-under-irc-code-section-1031 Whenever you sell business or investment property and you have a gain, you generally have to pay tax on the gain at the time of sale. IRC Section 1031 provides an exception and allows you to postpone paying tax on the gain if you reinvest the proceeds in similar property as part of a qualifying like-kind exchange. Gain deferred in a like-kind exchange under IRC Section 1031 is tax-deferred, but it is not tax-free. You may also sell your house for bitcoin and record the sales price on the deed with an equal or lesser amount that you bought it for. "A nondividend distribution is typically a return of capital; in other words, you're getting money back that you've contributed previously (and thus would have been taxed upon in previous years when those funds were first remunerated to you). Nondividend distributions are nontaxable, so they do not represent income from capital gains, but do effect your cost basis when determining the capital gain/loss once that capital gain/loss is realized. As an example, publicly-traded real estate investment trusts (REITs) generally distribute a return of capital back to shareholders throughout the year as a nondividend distribution. This is a return of a portion of the shareholder's original capital investment, not a share of the REITs profits, so it is simply getting a portion of your original investment back, and thus, is not income being received (I like to refer to it as ""new income"" to differentiate). However, the return of capital does change the cost basis of the original investment, so if one were to then sell the shares of the REIT (in this example), the basis of the original investment has to be adjusted by the nondividend distributions received over the course of ownership (in other words, the cost basis will be reduced when the shares are sold). I'm wondering if the OP could give us some additional information about his/her S-Corp. What type of business is it? In the course of its business and trade activity, does it buy and sell securities (stocks, etc.)? Does it sell assets or business property? Does it own interests in other corporations or partnerships (sales of those interests are one form of capital gain). Long-term capital gains are taxed at rates lower than ordinary income, but the IRS has very specific rules as to what constitutes a capital gain (loss). I hate to answer a question with a question, but we need a little more information before we can weigh-in on whether you have actual capital gains or losses in the course of your S-Corporation trade." If the charity accepts stock, you can avoid the tax on the long term cap gain when you donate it. e.g. I donate $10,000 in value of Apple. I write off $10,000 on my taxes, and benefit with a $2500 refund. If I sold it, I'd have nearly a $1500 tax bill (bought long enough ago, the basis is sub $100).  Any trading along the way, and it's on you. Gains long or short are taxed on you. It's only the final donation that matters here.  Edit - to address Anthony's comment on other answer - I sell my Apple, with a near $10,000 gain (it's really just $9900) and I am taxed $1500. Now I have $8500 cash I donate and get $2125 back in a tax refund. By donating the stock I am ahead nearly $375, and the charity, $1500. Purchasing stock doesn't affect your immediate taxes any more than purchasing anything else, unless you purchase it through a traditional 401k or some other pre-tax vehicle. Selling stock has tax effects; that's when you have a gain or loss to report. Brokerage->Brokerage 13-16 The loss from the previous purchase will be added to the cost basis of the security for the second purchase. Since you sold it at a loss again it would increase your losses. Your loss from the first sale will be disallowed. Your loss will be added to the cost basis of the next purchase. Your gains will be taxed on the total of the cost basis which will reduce your gains. Which you will taxed 'less'. Your gains will be taxed. Your loss is allowed. You will be taxed on both.  Wash Sales really only applies to losses. If you sell for gain, the tax man will be happy to take his share. From my understanding, it does not matter if it is IRA or Brokerage, the wash sale rule affects them all. Check this link: http://www.marketwatch.com/story/understanding-the-wash-sale-rules-2015-03-02