Skip to main content

Net Income 101 — and How to Track It in Beancount

· 5 min read
Mike Thrift
Mike Thrift
Marketing Manager

Of all the numbers that describe a business, one stands above the rest: net income. It’s the ultimate measure of profitability, the famous "bottom line." But what does it really mean, and how can you track it with precision using a plain-text accounting system like Beancount?

Let's break it down.

2020-03-12-net-income-101-how-to-track-it-in-beancount

What Net Income Really Means

At its core, net income is the money left over after you’ve paid for absolutely everything required to run your business. This includes the cost of goods sold (COGS), all operating expenses, interest on debt, and taxes.

It’s the clearest single indicator of a company’s financial health. It’s a critical figure for everyone:

  • Lenders look at it to gauge your ability to repay loans.
  • Investors see it as the source of potential dividends or the capital available for growth.
  • Founders rely on it to understand their financial runway and make strategic reinvestment plans.

A positive net income means you’re profitable. A negative one means you’re losing money. It’s that simple.

The Core Formula (Pick the Detail Level You Need)

You can calculate net income with varying degrees of granularity. The choice depends on how detailed an analysis you need.

  • Full Formula: Revenue – COGS – Operating Expenses – Interest – Taxes = Net Income
  • Standard Formula: Revenue – COGS – Expenses = Net Income
  • Quick & Dirty Formula: Total Revenues – Total Expenses = Net Income

A Quick Tip on Costs: What's the difference between COGS and operating expenses? COGS (Cost of Goods Sold) covers direct costs tied to producing your goods or services (e.g., raw materials, direct labor). Operating Expenses cover everything else that keeps the lights on—salaries, rent, software subscriptions, insurance, etc.

A Mini Example

Let's make this tangible. Imagine a small coffee roasting business had the following results last month.

ItemAmountExample Ledger Account
Sales Revenue$60,000Income:Sales
COGS (Green coffee beans)$20,000Expenses:COGS
Operating Expenses$18,000Expenses:Ops:*
Interest (On equipment loan)$1,000Expenses:Interest
Taxes$1,000Expenses:Taxes

Using the full formula, the calculation is straightforward:

$Net;Income = $60,000 - $20,000 - $18,000 - $1,000 - $1,000 = $20,000$

The business generated a true profit of $20,000 for the month.

How to Capture It in Beancount

Beancount’s structure is perfect for this. By organizing your accounts logically, calculating net income becomes an automatic byproduct of good bookkeeping.

  • Tag all revenue under a parent Income account, like Income:Sales or Income:Services.
  • Split your expenses to distinguish between direct and indirect costs. Use Expenses:COGS for direct costs and sub-accounts like Expenses:Ops:Salaries or Expenses:Ops:Software for everything else.
  • Post interest and taxes to their own accounts (Expenses:Interest, Expenses:Taxes). This makes future analysis, especially for tax preparation, much simpler.
  • Balance your books regularly. The fundamental accounting equation, Assets = Liabilities + Equity, must always hold true.

At the end of a period (e.g., a month), you can use balance assertions to confirm the state of your accounts. These entries don't move money; they declare what the balance should be, and bean-check will report an error if it isn't.

; 2025-07-31 Coffee Roaster Enterprises — July close
2025-07-31 balance Assets:Bank:Operating 42000.00 USD
2025-07-31 balance Expenses:COGS 20000.00 USD
2025-07-31 balance Expenses:Ops 18000.00 USD
2025-07-31 balance Expenses:Interest 1000.00 USD
2025-07-31 balance Expenses:Taxes 1000.00 USD
2025-07-31 balance Income:Sales -60000.00 USD

One-Line Net Income Query

This is where the magic happens. With a well-structured ledger, you can calculate your net income for any period with a single command.

bean-query books.beancount \
"SELECT period, sum(number) WHERE account =~ '^(Income|Expenses)' \
AND year = 2025 GROUP BY month"

This query sums up all values in your Income and Expenses accounts for 2025 and groups them by month. In Beancount, income is represented by negative numbers and expenses by positive ones, so the result will be the negative of your net income.

Even better, you don't even have to run this query manually. Fava, the web interface for Beancount, will plot this automatically for you in its Reports → Income Statement view.

Fast Insights You Can Automate

Because your ledger is just a text file, you can build powerful automated workflows around it.

  • Monthly E-mail Digest: Set up a cron job to run bean-report books.beancount income_statement > net-income.txt and then email the resulting text file to yourself on the first of every month.
  • Profitability Alert: Use a Git pre-commit hook that runs a query to check month-to-date profitability. You can program it to refuse the commit if net income is negative, forcing you to acknowledge a losing month.
  • Scenario Modeling: Want to stress-test your business? Just copy books.beancount to scenarios/recession.bean, reduce your Income entries by 20%, and rerun your net income query to see the impact instantly.

Key Takeaways

  • Net income is your true bottom line. The goal is to keep it positive and understand its trend over time.
  • Beancount makes the underlying math explicit, searchable, and version-controlled. There are no hidden formulas.
  • With a disciplined account structure and a single query, you’ll always know whether your business is truly making money.