HSA as a Stealth Retirement Account: Triple Tax Advantage Tracking in Beancount

Hey everyone! :waving_hand:

I’ve been deep in FIRE optimization mode lately, and I want to share something that’s become a cornerstone of my retirement strategy: using HSAs as a stealth retirement account that actually beats traditional 401(k)s and IRAs on tax advantages.

The Triple Tax Advantage (Better Than Any Other Account!)

Most people know about HSAs for medical expenses, but here’s the mind-blowing part: HSAs have a triple tax advantage that makes them the most powerful tax-advantaged account available:

  1. Tax-deductible contributions (beats Roth accounts)
  2. Tax-free growth (like both Traditional and Roth)
  3. Tax-free withdrawals for qualified medical expenses (beats Traditional accounts)

Compare this to:

  • Traditional 401(k)/IRA: Tax-deductible contributions + tax-deferred growth, but taxed on withdrawal
  • Roth 401(k)/IRA: After-tax contributions + tax-free growth + tax-free withdrawal (2 out of 3)
  • HSA: All three benefits! Plus no RMDs ever, and you can pay Medicare premiums tax-free after 65!

The Reimbursement Hack: The Secret Weapon

Here’s where it gets really interesting. IRS rules say you can reimburse yourself for qualified medical expenses at any time — there’s no deadline!

So the strategy is:

  1. Max out HSA contributions every year ($4,400 for individuals in 2026, $8,750 for families)
  2. Pay all current medical expenses out-of-pocket from your checking account
  3. Save every receipt (scan and archive digitally)
  4. Let your HSA investments compound tax-free for decades
  5. Reimburse yourself 20-30 years later for those old medical expenses — completely tax-free!

This is 100% legal and IRS-compliant. You’re building a “receipt bank” of future tax-free withdrawals.

My 2026 Strategy: Front-Loading and Investing

For 2026, I’m doing:

  • $4,400 contribution (individual coverage) — contributed in January for maximum growth time
  • 100% invested in VTSAX (total market index) — not keeping cash
  • $0 withdrawn — paying all medical expenses out-of-pocket
  • Every receipt saved in a digital vault with metadata

If I can save $200/month in medical expenses (insurance copays, dental, vision, prescriptions), that’s $2,400/year in “receipt bank” assets. Over 20 years at 7% growth, that’s potentially $98,000 in tax-free withdrawals I can access in retirement!

Tracking This in Beancount

Here’s my account structure:

; HSA accounts
2024-01-01 open Assets:HSA:Fidelity:Cash               USD
2024-01-01 open Assets:HSA:Fidelity:Investments:VTSAX  VTSAX
2024-01-01 open Income:HSA:Contributions

; Medical expenses (tracking reimbursement status)
2024-01-01 open Expenses:Medical:HSA-Reimbursable      USD
2024-01-01 open Expenses:Medical:Out-of-Pocket         USD

; Example: Paying dental bill out-of-pocket (NOT from HSA)
2026-03-10 * "Dentist - Cleaning and Filling"
  Expenses:Medical:HSA-Reimbursable     350.00 USD
    receipt: "2026-03-10-dental-receipt.pdf"
    hsa-qualified: TRUE
  Assets:Checking                      -350.00 USD

; Example: HSA contribution via payroll
2026-03-15 * "HSA Payroll Contribution"
  Assets:HSA:Fidelity:Cash              366.67 USD
  Income:HSA:Contributions             -366.67 USD

I use custom metadata tags to track:

  • receipt: - Link to scanned receipt PDF
  • hsa-qualified: - Whether expense is IRS-qualified for HSA reimbursement

Then I can query my “future tax-free withdrawal balance”:

SELECT sum(position) WHERE account ~ "Medical:HSA-Reimbursable"

This tells me how much I could withdraw tax-free from my HSA right now!

The FICA Bonus: Save an Extra 7.65%

One more optimization: if you contribute via payroll deductions (vs direct contributions), you save an additional 7.65% in FICA taxes (Social Security + Medicare). On $4,400, that’s an extra $337 saved!

After 65: Even More Flexibility

At age 65, HSAs become even better:

  • Still tax-free for medical expenses (including Medicare premiums!)
  • Can withdraw for any purpose (taxed like Traditional IRA, but no 20% penalty)
  • No required minimum distributions — let it grow forever if you want

My Question to the Community

How are others tracking HSA + medical receipt management in Beancount? I’d love to hear:

  • Your account structures
  • Receipt storage and linking strategies
  • Any Beancount queries or plugins you’ve built
  • Long-term users: have you successfully reimbursed old expenses?

For those pursuing FIRE: are you maxing HSA before Roth IRA? The math strongly suggests you should!

Looking forward to learning from this community!

— Fred

Fred, this is great information and I appreciate your enthusiasm for HSA optimization! As a tax professional, I want to add some critical compliance perspective to make sure folks implement this strategy correctly.

You’re Right About the Tax Benefits

The triple tax advantage is real and powerful. HSAs truly are one of the best retirement savings vehicles available from a pure tax perspective.

BUT: Critical Qualification Rules

Before anyone rushes to open an HSA, you MUST meet these requirements:

  1. You must be enrolled in a qualifying High Deductible Health Plan (HDHP)
    • For 2026: Minimum deductible of $1,600 individual / $3,200 family
    • Maximum out-of-pocket: $8,050 individual / $16,100 family
  2. You cannot be claimed as a dependent on someone else’s tax return
  3. You cannot be enrolled in Medicare (this catches people at 65!)
  4. No other disqualifying coverage (FSA, spouse’s non-HDHP, etc.)

The Reimbursement Strategy: Legal but Requires Perfect Documentation

Fred’s “receipt bank” strategy is 100% IRS-compliant, BUT you need to understand the documentation burden.

The IRS can audit HSA withdrawals for up to 6 years after you file. If you reimburse yourself for a 2026 medical expense in 2046, you need:

  • Itemized receipt showing date, provider name, service description, and amount
  • Proof of payment (credit card statement, cancelled check)
  • Evidence the expense was qualified under IRS Publication 969

Generic credit card statements like “Walgreens $47.23” won’t cut it. You need the actual itemized receipt showing it was prescription medication (qualified) vs cosmetics (not qualified).

Common Qualification Mistakes

Watch out for these expenses that people THINK are HSA-qualified but aren’t:

:cross_mark: Gym memberships (even with doctor recommendation)
:cross_mark: Cosmetic procedures
:cross_mark: Non-prescription vitamins and supplements
:cross_mark: Teeth whitening
:cross_mark: Most over-the-counter medications (unless prescribed)

:white_check_mark: Actually qualified:
✓ Prescription medications
✓ Doctor/dentist visits
✓ Vision care (exams, glasses, contacts)
✓ Mental health services
✓ Physical therapy
✓ Medical equipment

Form 8889: Annual Reporting

You must file Form 8889 every year you contribute to or withdraw from an HSA. This form reports:

  • Total contributions (employer + employee)
  • Total distributions
  • Whether distributions were for qualified medical expenses

The IRS doesn’t require you to submit receipts with your return, but you must keep them for audit purposes.

My Beancount Recommendation: Track Qualification Status

I suggest adding metadata to track whether expenses truly qualify:

2026-03-10 * "Dentist - Routine Cleaning"
  Expenses:Medical:HSA-Reimbursable     150.00 USD
    receipt: "2026-03-10-dental.pdf"
    hsa-qualified: TRUE
    irs-pub-969-section: "Dental Treatment"
  Assets:Checking                      -150.00 USD

2026-03-11 * "Dentist - Cosmetic Whitening"  
  Expenses:Medical:Not-Qualified        200.00 USD
    hsa-qualified: FALSE
    note: "Cosmetic - not deductible"
  Assets:Checking                      -200.00 USD

This way you’re tracking ALL medical expenses, but clearly separating what’s HSA-reimbursable vs what’s not.

Don’t Be Too Clever

The reimbursement delay strategy is legal, but it requires meticulous record-keeping for decades. If you can’t prove an expense was qualified when the IRS audits you in 2046, you’ll owe:

  • Income tax on the distribution
  • 20% penalty on non-qualified distributions (if under 65)
  • Interest and penalties for incorrect tax filing

My advice: This is a great strategy for disciplined, organized people. If you’re not confident you’ll maintain perfect records for 20-30 years, it might be safer to use HSA funds for current medical expenses and still enjoy the tax-free growth on the balance.

The FICA Savings: Even Better Than You Said

Fred mentioned the 7.65% FICA savings on payroll contributions. Actually, it’s even better for high earners:

  • If you’re self-employed, you save 15.3% (both employer and employee portions)
  • This applies to the ENTIRE contribution, making payroll deductions significantly better than post-tax contributions

Bottom Line

HSAs are incredible. Just make sure you:

  1. Actually qualify for HSA contributions
  2. Keep immaculate records
  3. Understand what expenses are truly qualified
  4. File Form 8889 correctly every year

Fred’s strategy is sound for the right person. Just go in with eyes open about the documentation commitment.

— Tina Washington, EA
Washington Tax Services

Fred and Tina, this is exactly the kind of discussion I love seeing! HSAs are genuinely underutilized by many of my clients, and the Beancount tracking approach Fred outlined is really smart.

Let me add the CPA perspective on implementation best practices, especially for the Beancount account structure.

Account Structure: Separating Reimbursable from Paid

Fred’s approach of separating Expenses:Medical:HSA-Reimbursable from regular medical expenses is brilliant. I’d extend it slightly:

Assets:HSA:ProviderName:Cash
Assets:HSA:ProviderName:Investments:VTSAX
Assets:HSA:ProviderName:Investments:VTIAX
Income:HSA:Contributions:Employer
Income:HSA:Contributions:Payroll
Income:HSA:Contributions:Direct

Expenses:Medical:HSA-Reimbursable    ; Paid out-of-pocket, eligible for reimbursement
Expenses:Medical:Paid-From-HSA       ; Already withdrawn from HSA
Expenses:Medical:Not-Qualified       ; Medical expenses that don't qualify

This structure lets you track:

  • Which medical expenses you’ve already reimbursed yourself for (moved to Paid-From-HSA)
  • Which ones are still available for future tax-free withdrawal (HSA-Reimbursable)
  • Which medical expenses don’t qualify for HSA reimbursement

The “Receipt Bank” Balance Query

Here’s a Beancount query to see your available “receipt bank”:

SELECT 
  account, 
  sum(position) as "Available for HSA Reimbursement"
WHERE 
  account = "Expenses:Medical:HSA-Reimbursable"
GROUP BY 
  account

Even better, you can calculate the opportunity cost of NOT reimbursing immediately:

If you have $5,000 in HSA-Reimbursable expenses and $5,000 in your HSA invested at 7% annual return, waiting 20 years to reimburse means your $5,000 grows to ~$19,350. The “cost” of reimbursing now is $14,350 in foregone growth!

Investment Allocation: Don’t Forget This Is an Investment Account

Many people contribute to HSAs but leave everything in cash earning 0.01%. Your HSA should be invested just like any retirement account!

Track it in Beancount with commodity prices:

2024-01-01 open Assets:HSA:Fidelity:Investments:VTSAX  VTSAX

2026-01-15 * "Buy VTSAX in HSA"
  Assets:HSA:Fidelity:Cash           -4400.00 USD
  Assets:HSA:Fidelity:Investments:VTSAX  10.5 VTSAX @ 419.05 USD
  
2026-03-13 price VTSAX  445.20 USD

This lets you see unrealized gains, track performance, and run the same investment analysis you do for your taxable/IRA accounts.

Payroll Contributions vs Direct Contributions

Tina’s right about the FICA advantage. There’s an important accounting distinction:

Payroll contributions (pre-tax):

2026-03-15 * "Payroll - HSA Contribution"
  Assets:HSA:Fidelity:Cash              366.67 USD
  Income:Salary                        -366.67 USD  ; Reduces gross income

Direct contributions (post-tax, but deductible):

2026-03-15 * "Direct HSA Contribution"
  Assets:HSA:Fidelity:Cash              366.67 USD
  Assets:Checking                      -366.67 USD

2026-12-31 * "HSA Deduction on Tax Return"
  Income:Tax:Deductions:HSA             366.67 USD
  Equity:Adjustments                   -366.67 USD

Payroll contributions are better because you never pay FICA taxes (7.65%) on that money.

Year-End Tax Planning Opportunity

HSAs are powerful for year-end tax planning. Unlike 401(k)s, you can contribute to an HSA up until April 15 of the following year and still count it toward the prior tax year.

This means in March 2027, you could still make a 2026 HSA contribution to reduce your 2026 taxable income. Very useful when you realize in tax season “oops, I owe more than expected!”

Tracking the Reimbursement Transaction

When you finally DO reimburse yourself (say, in 2046 for that 2026 dental bill), the Beancount transaction looks like:

2046-05-15 * "HSA Reimbursement for 2026 Dental Expenses"
  Assets:Checking                       350.00 USD
  Assets:HSA:Fidelity:Cash             -350.00 USD
    original-expense-date: "2026-03-10"
    receipt: "2026-03-10-dental-receipt.pdf"
    
; Also reclassify the original expense
2046-05-15 * "Reclassify reimbursed medical expense"
  Expenses:Medical:Paid-From-HSA        350.00 USD
  Expenses:Medical:HSA-Reimbursable    -350.00 USD

This keeps your books accurate and lets you query “total lifetime HSA distributions for qualified medical expenses” separately from “unreimbursed qualified expenses.”

Client Success Story

I have a client pursuing FIRE who’s been doing this since 2022. She’s now sitting on:

  • $18,000 in HSA investments (growing tax-free)
  • $6,400 in documented, unreimbursed qualified medical expenses (her “receipt bank”)

She can withdraw $6,400 tax-free, penalty-free, any time regardless of her age. It’s essentially a Roth IRA with better contribution limits and no income restrictions!

My Recommendation: Start Simple, Add Complexity

For folks new to this:

Year 1: Just track HSA contributions and basic medical expenses. Get comfortable with the account structure.

Year 2: Start separating reimbursable vs non-qualified medical expenses. Begin building your receipt archive.

Year 3: Add investment tracking, optimize contribution timing, build custom queries.

Don’t over-engineer on day one or you’ll burn out.

Professional Services Note

For my CPA colleagues: HSA advice is a great value-add service. Many clients don’t understand these accounts at all. Teaching them the “receipt bank” strategy positions you as a strategic advisor, not just a tax preparer.

And for anyone doing their own taxes: HSA mistakes are an audit red flag. The IRS knows people misuse these accounts. Keep perfect records!

Great discussion, everyone!

— Alice Thompson, CPA
Thompson & Associates

This is a fantastic thread! Fred, Tina, Alice — you’ve all covered the technical and tax aspects beautifully. Let me share some practical wisdom from actually living this strategy for the past 4 years.

My Real-World HSA + Beancount Journey

I started maxing out my HSA in 2022 when I discovered the “receipt bank” strategy. Like Fred, I was all-in on FIRE planning and wanted to optimize every dollar.

What I wish I’d known from day one:

The receipt management is harder than it sounds when you’re talking about 20-30 year horizons.

The Receipt Archive Challenge

Here’s what I learned:

Year 1 (2022): Overconfident

  • “I’ll just scan everything and save PDFs!”
  • Named files randomly: “receipt1.pdf”, “dentist.jpg”, “doctor_visit.pdf”
  • By December I had 47 medical receipts with no systematic organization
  • Couldn’t remember which ones were already in Beancount

Year 2 (2023): Learning

  • Created naming convention: YYYY-MM-DD-provider-amount.pdf
  • Example: 2023-04-15-dentist-285.00.pdf
  • Stored in Dropbox folder synced to multiple devices
  • Started linking filenames in Beancount metadata (like Fred showed)

Year 3 (2024): Systematic

  • Built a full workflow:
    1. Medical expense happens → Request itemized receipt immediately (don’t wait!)
    2. Scan receipt same day → Rename with convention
    3. Enter transaction in Beancount with metadata
    4. Verify receipt link works (click the path, does it open?)
    5. Weekly backup check (receipts folder syncs properly?)

Year 4 (2026): Confident

Now I have $8,200 in documented unreimbursed expenses from 2022-2026. I know I can withdraw that tax-free whenever I want.

I Actually Reimbursed Myself in 2026!

This is the coolest part: In January 2026, I reimbursed myself for $1,850 in 2023 dental work.

The process:

  1. Ran Beancount query to find all 2023 HSA-Reimbursable expenses
  2. Found the transaction with receipt: "2023-06-20-orthodontist-1850.00.pdf"
  3. Opened the PDF to verify (3 years old, still perfect)
  4. Initiated HSA distribution for $1,850
  5. Money arrived in checking account 3 days later
  6. Completely tax-free

It felt AMAZING. Like finding free money, except it was my own money I strategically didn’t touch for 2.5 years so it could grow.

Lessons Learned: Start Simple!

Alice’s advice about “start simple, add complexity” is spot-on. If I could redo my first year:

Minimum Viable HSA Tracking:

Assets:HSA:Cash
Assets:HSA:Investments
Expenses:Medical:Reimbursable

That’s it. Three accounts. Add fancy stuff later.

Critical habit: Request itemized receipts IMMEDIATELY. Don’t wait. Providers lose records, systems change, offices close. Get it now.

Receipt Storage: My Current System

After 4 years of iteration, here’s what works:

  1. Primary storage: Git repository (same repo as my Beancount ledger)

    • Folder: receipts/medical/
    • Naming: YYYY-MM-DD-provider-amount-description.pdf
    • Example: 2026-03-10-dentist-350-cleaning-filling.pdf
  2. Encryption: The receipts folder is encrypted (medical = PHI = privacy matters)

  3. Triple backup:

    • Git remote on private GitHub
    • Synced to Dropbox
    • Annual archive to external drive
  4. Beancount metadata:

2026-03-10 * "Dentist - Cleaning and Filling"
  Expenses:Medical:Reimbursable         350.00 USD
    receipt: "receipts/medical/2026-03-10-dentist-350-cleaning-filling.pdf"
    provider: "Dr. Sarah Chen DDS"
    hsa-qualified: TRUE
  Assets:Checking                      -350.00 USD

Now if I need to find that receipt in 2046, I have:

  • The Beancount transaction (searchable by date, amount, provider)
  • The relative path to the receipt
  • Multiple backup copies

The “Will I Really Keep These for 30 Years?” Question

Honestly? I don’t know yet. But here’s my thinking:

Option 1: Keep perfect records, reimburse in retirement → Maximum tax-free growth

Option 2: Lose some receipts over time → Still reimburse what I can document

Option 3: Life gets messy, records deteriorate → Use HSA for retirement medical expenses (still tax-free!)

All three options are better than NOT maxing out the HSA. The worst case is still a great outcome.

For FIRE Pursuers: Priority Order

If you’re pursuing FI and have limited cash, here’s my priority order (assuming employer 401k match is already maxed):

  1. HSA — $4,400/year (individual) — Triple tax advantage + no RMD
  2. Roth IRA — $7,000/year — Tax-free growth + contributions withdrawable anytime
  3. 401(k) — Up to $23,500/year — Tax-deferred, but RMDs at 73
  4. Taxable brokerage — Unlimited — Least tax-advantaged, most flexible

The HSA wins on pure tax math. Plus, if you retire early (say, age 45), you WILL have medical expenses between 45-65 before Medicare kicks in. That HSA will be a lifesaver.

My Encouragement to Fred and Others Starting Out

You’re doing this right, Fred. The fact that you’re thinking about receipt metadata and account structure from day one means you’re going to succeed.

Don’t let perfection be the enemy of good. Start tracking now, even if your system isn’t perfect. You can always improve it next year.

And to everyone else: if you have access to an HDHP and HSA, use it. Even if you don’t implement the fancy reimbursement delay strategy, just maxing out contributions and letting it grow is powerful.

The combination of HSA + Beancount + long-term thinking is genuinely one of the best FIRE tools available.

Thanks for starting this discussion, Fred. Looking forward to comparing notes in a few years!

— Mike Chen
4+ years Beancount, 4+ years HSA optimization, still learning