Ever wonder how much your side hustle has earned you some coffe bucks, but also accrued income tax? If you have a day job and a side hustle, and that side hustle is earning you some money, you should set aside some money to write a check to your tax bureau next year.

I’ve been managing my finances with Ledger CLI and I just discovered how to easily estimate my next year’s income tax bill. The keyword is “Virtual Posting.”

To give context, Canada treats any personal income as a whole, so any side hustle will accrue income tax at my marginal tax rate. Here’s how my income and expenses look like:

2019-01-01 * Salaries paid (and income tax deducted)
	Income:Salaries					-$2,500
	Expenses:Income Tax				$500
	Expenses:Healthcare:Insurance	$100
	Asset:Checking Account			$1,900

2019-01-01 * Side hustle income
	Income:Side Hustle				-$300
	Asset:Checking Account			$300

2019-01-01 * Side hustle costs
	Expenses:Business Expenses		$50
	Asset:Checking Account			-$50

Assume I’m to receive such side hustle income every month, and this $50 expense is one-time and fully deductible. At my marginal income rate of 20%, I will have accrued ($300 x 12 - $50) x 20% = $710 in income tax payable to the CRA (the tax bureau) next year. If you don’t have super big cash cushion, you may want to be prepared.

Fortunately, with the feature of “Virtual Postings” and “Automated Transactions,” you can easily track your income tax payable:

= /^Income:Side\ Hustle/
	(Liabilities:Income Tax Payable)	0.20

= /^Income:Salaries/
	(Liabilities:Income Tax Payable)	0.20

= /^Expenses:Business\ Expenses/
	(Liabilities:Income Tax Payable)	0.20

= /^Expenses:Income\ Tax/
	(Liabilities:Income Tax Payable)	1.00

In a nutshell, these automated transactions adds 20% to my eligible income, and removes 100% of the income tax I actually paid. A few things to decompose here:

  • = /expr/ marks automated transactions. When a posting’s account matches the pattern defined by expr, the postings in this automated transaction definition will be appended to the posting.

  • (Account) marks the posting as a virtual posting. You don’t have to balance a virtual posting, and you can remove these postings from reports with --real flag.

  • 0.20 defines the ratio of the amount to the matching posting. 0.20 will add 20% of the posting amount, and since income is recorded as negative, this will increase my liabiilities; when I pay tax (either through payroll deduction or by writing a cheque), 1.00 adds 100% to the positive expense, decreasing my liabilities.

At the end of the year, you can simply use a quick command to estimate your income tax payable:

ledger -f file.ledger bal ^Liabilities:Income\ Tax\ Payable

Of course, make sure to consult your tax forms and an accountant if necessary.