**The information below has not been verified for the 2023 tax year as the IRS Pub. 550 has not yet been released by the IRS.**
A stock split will affect your number of shares and your basis in each share. To determine your new basis per share, you would divide your total adjusted basis of the old stock by the number of shares you hold after the split. If all of the shares are sold together, this will not affect your gain or loss because you will enter the total purchase price and the total sales price for purposes of calculating your gain (loss).
Per IRS Publication 550 Investment Income and Expenses (Including Capital Gains and Losses), page 35:
Stocks and Bonds
The basis of stocks or bonds you own is generally the purchase price plus the costs of purchase, such as commissions and recording or transfer fees. If you acquired stock or bonds other than by purchase, your basis is usually determined by fair market value or the previous owner's adjusted basis as discussed earlier under Basis Other Than Cost.
The basis of stock must be adjusted for certain events that occur after purchase. For example, if you receive more stock from nontaxable stock dividends or stock splits, you must reduce the basis of your original stock. You must also reduce your basis when you receive nondividend distributions (discussed in chapter 1). These distributions, up to the amount of your basis, are a nontaxable return of capital.
Note that any link in the information above is updated each year automatically and will take you to the most recent version of the webpage or document at the time it is accessed.