Introduction

Restricted Stock Units (RSUs) are a common part of compensation packages in tech and other industries. They can represent a significant portion of your income—but they also introduce complexity to your personal finances. RSUs vest over time, are subject to income taxes when they vest, and may later be sold, triggering capital gains.

If you’re already using Beancount to track your finances, it’s worth bringing your RSUs into the ledger. In this post, we’ll walk through how to record RSUs in Beancount in a way that keeps your records clean, auditable, and tax-ready.

The Beancount example in this post can be found in: https://github.com/flyaway1217/beancount_example/blob/main/single_examples/RSU.bean

RSU Lifecycle Overview

Before jumping into the Beancount syntax, let’s briefly review how RSUs work:

  • Grant Date: You’re promised a certain number of shares—typically recorded only as a memo at this point.
  • Vesting Date: The shares legally become yours. The market value is treated as ordinary income, and income tax is due.
  • Settlement: The shares are deposited into your brokerage account. Sometimes taxes are withheld by selling a portion of the vested shares.
  • Sale: You sell the shares. Any additional gain (or loss) from the time of vesting to sale is treated as a capital gain or loss.

Beancount lets you model this lifecycle clearly using plain-text journal entries.

Required Accounts

As usual, we need to define some commodities and accounts.

First we need to define two commodities:

1
2
3
2023-01-01 commodity USD
2023-01-01 commodity AMZN
2023-01-01 commodity AMZN.UNVEST

AMZN is the actual stocks shares we received and AMZN.UNVEST represents the shares that have not vested yet.

Next, we define the Asset accounts:

1
2
3
4
2023-01-02 open Assets:Investment:Stock:MorganStanley:AMZN AMZN
2023-01-02 open Assets:Others:UnvestedStock:MorganStanley:AMZN AMZN.UNVEST
2023-01-02 open Assets:Others:RSURefund:Amazon USD
2023-01-02 open Assets:Saving:Chase

The first two Asset accounts are used to hold the vested and unvested stock shares. The third one is an intermediate account, serves as a help account to move stocks from unvested to vested state. We will see how to use this account in the later part of this post. The last asset account is the designated account that to receive any leftover cash after paying taxes.

We also need to define some necessary Income and Expenses accounts. Since the award is part of the compensation, which accounts as an income. We use an Income account to track the unvested shares we received. When vesting, we use an Expenses account to track the total vested shares over the time.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
2023-01-02 open Income:Work:Amazon:Awards AMZN.UNVEST
2023-01-02 open Income:Work:Amazon:Earnings:RSU USD

; Keep tracking the number of units that have been vested
2023-01-02 open Expenses:NonTaxes:Passive:Vested:Amazon AMZN.UNVEST
; Taxes related accounts
2023-01-02 open Expenses:Taxes:FederalIncomeTax:Withhold USD
2023-01-02 open Expenses:NonTaxes:Active:Finance:Commission USD
2023-01-02 open Expenses:NonTaxes:Active:Finance:FinancialFees  USD
2023-01-02 open Expenses:Taxes:FederalMedicareTax USD
2023-01-02 open Expenses:Taxes:FederalSocialSecurityTax USD

Step-by-Step Recording

Now, let’s start tracking the RSUs!

Granting RSUs

When receiving an award, we record it as an income:

1
2
3
2023-04-01 * "Amazon" "RSU award"
    Income:Work:Amazon:Awards                   -474 AMZN.UNVEST
    Assets:Others:UnvestedStock:MorganStanley:AMZN       474 AMZN.UNVEST

This is a simple transaction that logs the awards as an Income.

Vesting

When vesting, the broker firm that administrates your RSU takes the following actions:

  • Use the current market stock price to compute the total value you received. This accounts as the Income you received.
  • Based on the total income value, taxes is computed.
  • Then the firm will sell necessary shares using the market price to cover these taxes.
  • The remaining shares will be deposited into your personal account. Until this point, the shares (after selling for taxes) you received officially becomes yours.
  • Deposits any leftover cash (after tax withholding) into your designated bank account.

To reflect the above events properly in Beancount, we divide the process into two steps:

  • First, we receive an income in the form of cash. This is a taxable event.
  • Second, we convert the cash into the stock shares.

Taxable Income Event

To record the taxable income, we treat it like a normal salary:

1
2
3
4
5
6
7
8
; Vesting step 1: receive the compensation in the form of cash
2024-05-21 * "Vesting Event"
    Income:Work:Amazon:Earnings:RSU                 -39,934.22 USD
    Expenses:Taxes:FederalIncomeTax:Withhold          8,785.53 USD
    Expenses:Taxes:FederalSocialSecurityTax           2,475.92 USD
    Expenses:Taxes:FederalMedicareTax                   579.05 USD
    Assets:Saving:Chase                                 316.00 USD
    Assets:Others:RSURefund:Amazon

In the above example, we received 39,934.22 dollars as regular income, which is the total market value of vested stock shares. We also pay income taxes. We record them as expenses. Then, the remaining cash is deposited my bank account and intermediate account. The 104.92 dollars is the leftover after selling some stocks and paying the taxes. These cash will be deposited into your bank account in cash.

Convert into Your Stocks

Next, we need to convert the cash value in Assets:Others:RSURefund:Xiaowan:Amazon because ultimately we received the income in the form of stocks.

1
2
3
4
5
6
7
8
; Vesting step 2: converting the cash into stock units, logging the cost basis
2024-05-21 * "Conversion into shares"
    Assets:Investment:Stock:MorganStanley:AMZN             153 AMZN {181.5192 USD}
    Assets:Others:RSURefund:Amazon                  -27,777.72 USD
    Expenses:NonTaxes:Active:Finance:Commission           4.95 USD
    Expenses:NonTaxes:Active:Finance:FinancialFees
    Assets:Others:UnvestedStock:MorganStanley:AMZN        -220 AMZN.UNVEST
    Expenses:NonTaxes:Passive:Vested:Amazon                220 AMZN.UNVEST

In the above example, we vested 153 shares AMZN stocks into our private stock account with the market price of 181.52 dollars, resulting the total value of 27,777.72 dollars, which is exactly the same amount in the account Assets:Others:RSURefund:Amazon. Also, in this transaction, we need to pay some transaction fees. The last two lines record the real stocks shares vested: we in total vested 220 shares, but 67 shares of them are sold to pay for the taxes, the remaining 153 shares are deposited into our private stock account. This information can be found in your broker statement.

Why Two Steps

Using a two-step accounting approach:

  • First, receive the income as cash, triggering the tax event.
  • Then, convert the cash into actual stocks.

This method makes it easier to manage the taxable event and cost basis of the stocks. Trying to log both in a single transaction would complicate the ledger and make audit trails harder to follow.

Tips and Best Practices

Use Subaccount to Track Different Awards

Most tech companies grant RSUs yearly, with vesting schedules spanning several years. This means you’ll likely have multiple active awards at once. It’s helpful to use subaccounts to distinguish them:

1
2
2023-01-02 open Assets:Others:UnvestedStock:MorganStanley:AMZN:RS2821149 AMZN.UNVEST
2023-01-02 open Assets:Others:UnvestedStock:MorganStanley:AMZN:RS3118736 AMZN.UNVEST

Where RS2821149 and RS3118736 are the award number provided by your company or broker firms. You can use any identifier you want.

Asserting the Intermediate Account

1
2024-05-22 balance Assets:Others:RSURefund:Amazon  0 USD

The intermediate account shouldn’t retain any funds—its balance should go to zero after each conversion. It’s good practice to include assertions like the one above to verify this and catch bookkeeping errors early.

Final Thoughts

RSUs are a powerful form of compensation, but they come with a web of tax implications and tracking challenges. By bringing them into your Beancount ledger, you gain full visibility over your awards, vesting schedules, and eventual capital gains. More importantly, you create an auditable record that makes tax reporting easier and reduces surprises during filing season.

While this post provides a general framework, feel free to tailor the account structure or add metadata to suit your workflow. And remember—keeping detailed records isn’t just about taxes; it’s also about understanding the real value of what you’ve earned.

As always, consistency in how you record RSU events will pay off in clarity and peace of mind down the road.

References