IRS Publication 550 Investment Income and Expenses (Including Capital Gains and Losses), page 49:
Capital or Ordinary Gain or Loss
If you have a taxable gain or a deductible loss from a transaction, it may be either a capital gain or loss or an ordinary gain or loss, depending on the circumstances. Generally, a sale or trade of a capital asset (defined next) results in a capital gain or loss. A sale or trade of a noncapital asset generally results in ordinary gain or loss. Depending on the circumstances, a gain or loss on a sale or trade of property used in a trade or business may be treated as either capital or ordinary, as explained in Pub. 544. In some situations, part of your gain or loss may be a capital gain or loss, and part may be an ordinary gain or loss.
Capital Assets and Noncapital Assets
For the most part, everything you own and usefor personal purposes, pleasure, or investmentis a capital asset. Some examples are:
Any property you own is a capital asset, except the following noncapital assets:
Investment property. Investment property is a capital asset. Any gain or loss from its sale or trade is generally a capital gain or loss.
Gold, silver, stamps, coins, gems, etc. These are capital assets except when they are held for sale by a dealer. Any gain or loss from their sale or trade is generally a capital gain or loss.
Stocks, stock rights, and bonds. All of these, including stock received as a dividend, are capital assets except when they are held for sale by a securities dealer. However, see Losses on Section 1244 (Small Business) Stock and Losses on Small Business Investment Company Stock, later.
Personal use property. Property held for personal use only, rather than for investment, is a capital asset, and you must report a gain from its sale as a capital gain. However, you cannot deduct a loss from selling personal use property.
Capital asset treatment for self-created musical works. You can elect to treat musical compositions and copyrights in musical works as capital assets when you sell or exchange them if:
You must make a separate election for each musical composition (or copyright in a musical work) sold or exchanged during the tax year. Make the election by the due date (including extensions) of the income tax return for the tax year of the sale or exchange. Make the election on Form 8949 and Schedule D (Form 1040 or 1040-SR) by treating the sale or exchange as the sale or exchange of a capital asset, according to Form 8949 and Schedule D (Form 1040 or 1040-SR) and their separate instructions.
You can revoke the election if you have IRS approval. To get IRS approval, you must submit a request for a letter ruling under the appropriate IRS revenue procedure. See, for example, Revenue Procedure 2020-1, available at IRS.gov/irb/2020-01_IRB#REV-PROC-2020-1. Alternatively, you are granted an automatic 6-month extension from the due date of your income tax return (excluding extensions) to revoke the election, provided you timely file your income tax return, and within this 6-month extension period, you file Form 1040-X that treats the sale or exchange as the sale or exchange of property that is not a capital asset.