Accounting for health-related expenses in the U.S. is slightly different from typical expense tracking because it usually involves insurance. In this post, we’ll walk through how to use Beancount to track your healthcare expenses in the U.S.
How Healthcare System Work in US

How healthcare system works
In its simplest form, the healthcare system typically works as follows:
- You visit a healthcare provider who delivers medical services to you.
- The provider submits claims to your insurance company.
- The insurance company verifies the claims and pays a portion (or all, depending on your coverage).
- Once the claims are processed, the healthcare provider sends you a bill for the remaining amount.
- The insurance company also sends you an Explanation of Benefits (EOB), detailing how your medical claims were processed based on your plan.
As a patient, there are two important documents you should pay attention to:
- The EOB provided by your insurance company.
- The bill sent by your healthcare provider.
Ideally, these two statements should match.
EOB and bills can be mismatched!
I’ve had an experience where they didn’t align. It turned out to be the healthcare provider’s mistake, and I ended up overpaying. This issue came to light months later during a financial review using Beancount.
We’ll use these two statements to track our healthcare expenses in Beancount.
What Numbers to Track
When tracking healthcare expenses, we aim to record the following amounts1:
- Total claims/bills: The full amount charged by the healthcare provider, regardless of who pays.
- Patient savings: The portion covered by the insurance company, broken down into:
- Plan Discount: The negotiated discount between your insurer and in-network providers, typically lower than standard service charges.
- Plan Paid: The actual amount the insurance company pays.
- Amounts you owe / your cost: The portion you’re responsible for after the insurance payment.
By tracking these values, you can answer:
- How much has my insurance plan saved me?
- What are my total out-of-pocket healthcare expenses?
Track Healthcare Expenses in Beancount
Let’s first design the account structure.
For healthcare expense accounts, I use the following convention: Expenses:Health:HealthType:InsuranceCompany:Plan:SubAccounts
|
|
In the above example, I use Blue Shield insurance company’s PPO plan.
I also open a Liabilities
account to hold my liabilities. Because you
probably will receive the bills and EOB at different times.
A typical healthcare transaction is like the following:
|
|
When visualized in Fava, the accounts display like this:

Healthcare Expenses in Fava
This view summarizes all the key totals:
- Total healthcare expenses
- Total out-of-pocket costs
- Insurance savings
Final Words
Tracking healthcare expenses in the U.S. can be confusing due to the involvement of insurance companies, negotiated discounts, and delayed billing. By leveraging Beancount, you gain clarity and control over your medical spending. With a structured approach to categorizing claims, discounts, and out-of-pocket costs, you can make better financial decisions and catch discrepancies early—just like I did.
I hope this guide helps you better understand and track your healthcare expenses using plain-text accounting. Feel free to adapt the account structure to fit your specific insurance provider and coverage details.
If you have questions or improvements to suggest, I’d love to hear from you.
References
- Health Care Expenses from official document of Beancount.
-
If you want, you can further track the copay, deductible or other items in the EOB. Here, for simplicity, I only track the most important amounts in this post. ↩︎