How do you enter buying and selling ESPP (Employee Stock Purchase Plan) shares in gnucash?

For example, say one purchased 100 SHS of XYZ on 5/1/18, a grant date of 12/31/17, where the acquisition fair market value (FMV) was $10, acquisition price $8.50, and a grant-date price of $7.

Also assume a 15% discount.

How do you make all these moving parts fit?

  • 1
    As far as I know, you'll handle this like any other stock sale. The spread between FMV and acquisition price can be treated as an unrealized gain (an income account). When you sell, you'll charge any additional unrealized gain against an ordinary income account and a capital gains account (either long or short). The amount of each type depends on how long you held the stock.
    – chepner
    Sep 8, 2020 at 20:49

1 Answer 1


I use the following account structure to track my ESPP (XXX is the company stock ticker)

Assests:Current Assests:Investments:ETrade Brokerage:Cash
Assests:Current Assests:Investments:ETrade Brokerage:ESPP Cash
Assests:Current Assests:Investments:ETrade Brokerage:XXX
Income:ESPP Bonus (Marked as W2 Income in Tax Options)

Money comes out of my paycheck into ESPP Cash every pay period. On the purchase date I do a split purchase at the FMV price with the employee portion coming out of ESPP Cash and the employer portion coming from ESPP Bonus. This works because I sell all my ESPP shares as soon as I get them. If you plan to hold your shares until later years and you still want tax reporting to work you could add a Liabilities:ESPP Bonus account that pays for the shares at purchase and in years that you sell the stock you would need to transfer from Income:ESPP Bonus into Liabilities:ESPP Bonus to satisfy that account and generate the taxable record.

Selling the stock is just a sale from XXX to Cash with splits for the brokerage fees.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .