Double-Entry Accounting Guide for Software Engineers — Part Two: How double-entry works

Sergey Radzishevskii
10 min readJan 5, 2024
Photo by Alvaro Reyes on Unsplash

In the previous article, we looked at how the double-entry system helps prevent errors in applications. In this part let’s try to understand how the double-entry system works and what are key building blocks of an accounting system are.

The internet abounds with articles explaining the double-entry system. I’ll be candid, comprehending its workings wasn’t straightforward for me. Hence, I’d like to propose my approach to help you grasp the concept of the double-entry system. May professional accountants forgive me if I make mistakes.

Most of the guides that I found throw you into the mess of accounting terms and just confront you with the fact that this is how it works. But it’s not clear why it works this way. So I’ll try to explain how it works from a different perspective.

Money doesn’t appear from thin air

Last time, we discussed how money doesn’t just appear magically out of thin air. Money always comes from somewhere, like profits, funds from a bank loan, or investments from stakeholders. Simultaneously, the money that enters the system is always put to some use. We can deposit money into our bank account or use it to purchase assets — whether it’s office equipment or raw materials for production, there’s always a purpose. This concept is simple and logical. We can state that money always has a source and a use. This fundamental idea, which prevents money from appearing magically, serves as the cornerstone of the double-entry system. It’s worth noting that this system was developed in the 14th century, and the practice of indicating the source of money was truly groundbreaking at that time.

Let’s take it one step at a time, avoiding the immediate use of complex accounting terminology. And the fictional story of the creation of the Firecnc company will help us with this.

Firecnc founder, Tom, decided to start the company with his own funds as seed capital. To kickstart the venture, he opened a dedicated Firecnc business bank account and transferred $100,000 of his own money into it.

Equity = Assets

Let’s categorize sources and uses of money. Owner’s funds represent equity, and the money in the Firecnc bank account constitutes company assets. These categories are not random; they are crucial for helping us grasp how the double-entry system functions. Remember, all money (or any value) entering the system must be assigned a category.

Now the company has $100,000 in its bank account. That’s all the assets that the company has at this point — money in their bank account. At the same time, we may say that the company is worth $100.000, if we sell all the assets we will get the same amount. At this point, we may say that

Equity = Assets

Tom realizes that $100,000 is insufficient to launch the company successfully, so he seeks additional funding. He secures a bank loan worth $300,000. As a result, the Firecnc bank account now holds $400,000. However, it’s important to acknowledge that we also have an obligation to repay the bank loan. Let’s categorize the bank loan as a liability for the company.

Assets = Equity + Liabilities

You can see that the money the company gets matches the money it spends.

$100,000 + $300,000 = $400,000

This is the main idea behind double-entry records — to keep track of where the money comes from and where it goes. These values must match.

We will also have income and expenses in our categories. But let’s skip them for now to keep things simple.

Every Dollar Finds Its Purpose

Let’s include more examples to see how this principle functions. Firecnc received $600,000 in new funds from a venture investment company and transferred these funds to our bank account.

We classify these venture funds as equity and increase our assets by the same amount. To provide further clarity, we can express this as:

Assets = Liabilities + Equity

or we can rewrite it in another way

Equity = Assets — Liabilities

And state that equity is what’s left for the owners of the company after all its debts and obligations have been settled.

In our case, Equity ($700K) = Assets ($1M in the bank) — Liabilities ($300K bank loan). At this point, $700K represents the funds contributed by owners and the venture capital firm

Let’s move money from one pocket to another.

Now, Tom needs an office to build the team. Tom purchased chairs, laptops, and some office supplies, spending a total of $20,000.

We spent $20,000 from the company’s bank account, but at the same time, we acquired office equipment worth the same amount. Office equipment falls into the assets category as well. You can see that the total value of assets hasn’t changed, and we also haven’t reflected these changes in equity.

Another example of moving money from one pocket to another can occur when it’s time to pay off a bank loan, and we need to pay $50,000. We prefer not to use funds from the Firecnc bank account. Instead, we raise additional funds from the owners.

We repaid $50,000 of debt to the bank, but now we owe $50,000 to the owners. The overall value of equity and liabilities has not altered, and the value of assets remains consistent. We still have $1M on both sides.

Double Entry Record

Moving step by step toward understanding the double-entry record. We now understand the importance of tracking both the source and the purpose of money. Additionally, we aim to monitor transactions involving the transfer of funds between accounts without impacting the total assets.

Let’s try to record some of the transactions that we mentioned above.

  • Tom transfers $100,000 of his own money to the Firecnc bank account
  • Tom takes a bank loan for $300,000

Let’s try to think how would we record these transactions.

For convenience, I continue to indicate the use in blue and the source in green.

We have two double-entry entries where we capture both the source and the use of money. If we calculate the balances in each account, we will obtain

If we add up the balances in the green and blue accounts, you will notice that the total is the same — $400,000. This means that the amount of money we receive and the amount of money we used are equal.

Now let’s add transactions where we “move money from one pocket to another”

  • Tom pays off a $50,000 bank debt using money from his own funds
  • Tom bought office equipment for $20000

The final sum of use and source is the same — $350000. Checking our equation: Assets = Liabilities + Equity, $330000 + $20000 = $250000 + $100000

Does this resemble what a double-entry record looks like? Well, somewhat, but not quite.

Debit and Credit

Let’s simplify things by forgetting about debts and removing liabilities. We’ll use the equation from our first example.

If we look at our equation we can derive some rules:

  • If assets increase, then equity must increase by the same value.
  • If assets decrease, then equity must decrease by the same value.
  • We can rearrange assets without changing their total value, and equity remains the same.
  • Similarly, we can rearrange equity without changing its total value, and the value of assets remains the same.

Looking at the table, you might notice that the first two transactions had the same numbers. This happens when we make changes to both sides of the equation. When we rearrange things, we still have the same amount, just with different signs. Here’s the interesting part: the double-entry system was around before negative numbers were a thing. But don’t worry about that, let’s see how cleverly the double-entry system deals with this situation.

If we eliminate negative numbers, we would have just one column of amounts since the value would always be the same. Therefore, instead of using negative numbers, the double-entry system categorizes accounts into two types: debit normal and credit normal accounts. Accounts used as sources (green accounts) are categorized as credit normal accounts, while accounts used as uses (blue accounts) are categorized as debit normal accounts.

Then, it introduces two operations: debit and credit, each following specific rules for the accounts.

  • When we make a debit entry in a Debit normal account, its balance increases.
  • When we make a credit entry in a Debit normal account, its balance decreases.
  • When we make a debit entry in a Credit normal account, its balance decreases.
  • When we make a credit entry in a Credit normal account, its balance decreases.

Now if we look again at our simplified equation

With the account rules above, we can map the rules mentioned earlier to the following table.

You might notice that in every row in the table, we use two operations: one debit and one credit. This is what double-entry is all about — it ensures our equation stays balanced. Now, let’s rewrite our transactions using double-entry records.

We’re not using negative numbers anymore. In the first transaction, when we receive new funds from owners, we do two things:

  1. We add money to the Firecnc Bank account, which is a “Debit normal” account. This makes its balance go up.
  2. We also increase the balance of the Owner Funds account by recording a credit entry. Owner Funds is a “credit normal” account.

Again, remember our equation: Assets = Equity. We increased assets, and we also increased equity.

Now, let’s look at the third transaction where we debit and credit Credit normal accounts. We decreased the bank loan, but we increased the owner's funds. In the end, Liabilities + Equity remained the same.

So, in simple terms, when we have an entry with accounts of the same type (color), we transfer money from one pocket to another. These transactions don’t change the value of assets.

Double-entry accounting doesn’t use colors; I’ve used colors here to simplify understanding. In practice, accountants know which account is debited and which account is credited without the use of colors.

Now, when we revisit the table, you might wonder why we bother tracking both debit and credit amounts if they are the same in each entry. Indeed, in our current scenario, they are the same, but there may be situations where we want to divide them. For example, let’s say we receive funds from owners, but we prefer not to put all our funds in one place. Instead, we decide to split this amount between our primary bank accounts and a separate savings account.

Note that the sum of the credits must always be the same as the sum of all debit entries.

Income and Expenses

We’ve discussed assets, liabilities, and equity, but what about income and expenses? These are particularly intriguing because every company deals with profits and costs. However, in the realm of double entries, there’s no distinction. We’ve simply left out these categories to maintain simplicity. Income represents the source of money, while expenses represent the use. Consequently, accounts treated as income are credited, and accounts categorized as expenses are debited. Let’s expand our diagram.

Let’s review a few examples and create double entries for them.

A user pays $15 for the subscription. The payment provider deducts $1.2 for payment processing, leaving $13.8 to be deposited into the bank account.

Mastering the Art of Financial Logic

In our journey through Double-Entry Accounting for Software Engineers, we’ve unraveled the complexity of financial record-keeping. We’ve emphasized that money always has a source and a purpose, forming the basis of the double-entry system.

We introduced debits and credits, the system’s core, ensuring balance in financial equations. This guide equips software engineers with a simplified grasp of double-entry accounting, empowering them to navigate financial aspects with confidence, essential for any business’s success.

If you find something unclear or incorrect, please feel free to share your feedback in the comments. Your insights are valuable as we strive for clarity and accuracy in understanding this essential aspect of financial management.

In the next part, we will proceed to build a ledger for our Firecnc application, model various financial operations, and dive into actual coding to implement these processes.



Sergey Radzishevskii

Enjoy turning complex systems into intelligible architectures chilling in my garden.