Skip to content
memoDwarves Foundation

Research notes/Financial systems

Double-entry accounting basics for engineers

Learn the basics of double-entry accounting, including assets, liabilities, equity, and how this system improves accuracy over single-entry bookkeeping for better financial tracking and reporting.

Written 4 years ago. Check versions before you rely on it.

Introduction

Double-entry accounting states that every financial transaction has equal and opposite effects in at least two different accounts. There are 3 main accounting types associated with this: assets, liabilities, and equity.

Accountants have an accounting equation, and it is used to check whether the bookkeeper has made a mistake if it is ever out of balance. This equation is commonly used in balance sheets/statement of affairs:

Assets=Liabilities+Equity\text{Assets} = \text{Liabilities} + \text{Equity} Assets=Liabilities+Equity

[!INFO] We can derive a person's net worth to be the total equity they have:

>Equity (Net Worth)=Assets−Liabilities>> \text{Equity (Net Worth)} = \text{Assets} - \text{Liabilities} > >Equity (Net Worth)=Assets−Liabilities>

How is it different from single-entry?

Single-entry accounting involves writing down all entity transactions (revenues, expenses, payroll, etc.) in a single ledger. The database equivalent is a list of transactions that add or subtract money from an account. This lack of detail in recording makes it difficult to track assets and liabilities, and it is prone to mistakes.

Single-entry example

The single-entry example allows us to calculate a closing balance, but it doesn't have the granularity to tell us whether this balance is from our bank balance or our total commodities.

DateDetailsAmount (USD)
Jan 1, 2020Opening Balance0.00
Jan 5, 2020Initial Investment5000
Jan 9, 2020MacBook purchase-2000
Jan 11, 2020Domain Registration (1 year)-35
Jan 14, 2020Web Hosting Fees (1 year)-100
Jan 16, 2020Advertising Expense-20
Jan 18, 2020Product Sales50
Jan 20, 2020Bank Fees-2
Jan 23, 2022Product Sales100
Jan 27, 2022Taxes-300
Closing Balance2693

Double-entry example

The double-entry example allows us to derive balances for our assets and liabilities on top of checking whether our assets, liabilities, and equity balance each other out.

DateDetailsLabel (Account)Debit (USD)Credit (USD)
Jan 1, 2020Opening BalanceAssets:Bank0
Equity:Opening Balance0
Jan 5, 2020Initial InvestmentAssets:Bank5000
Equity:Opening Balance5000
Jan 9, 2020MacBook purchaseEquity:Expenses:Electronics2000
Assets:Bank2000
Jan 11, 2020Domain Registration (1 year)Equity:Expenses:Web35
Liabilities:Credit Card35
Jan 14, 2020Web Hosting Fees (1 year)Equity:Expenses:Web100
Liabilities:Credit Card100
Jan 16, 2020Advertising ExpenseEquity:Expenses:Marketing20
Assets:Bank20
Jan 18, 2020Product SalesAssets:Bank50
Equity:Revenue50
Jan 20, 2020Bank FeesEquity:Expenses2
Assets:Bank2
Jan 23, 2022Product SalesAssets:Bank100
Equity:Revenue100
Jan 27, 2022Sales TaxLiabilities:Taxes:Sales15
Assets:Bank15
Total73227322

Reasons and proponents for accounting in double-entry

In a double-entry accounting system, a debit in one account offsets a credit in another, the sum of all debits must equal the sum of all credits. The system standardizes the accounting process and improves the accuracy of prepared financial statements, and enables us to detect errors in cases of fraud or laundering.

Double-entry systems, regardless of whether we keep track of journal entries, allow us to create reports on income statements, balance sheets, statements of cash flows, and statements of retained earnings.

Database design

For database design, refer to database design for double-entry accounting.


Accounting types

Assets

"How much do I have?"

Assets refer to anything of value that an entity owns. They are represented as a debit balance. Assets are generally divided into 2 categories:

  • Current assets: anything that can be consumed, sold, or converted into cash within a year
    • Inventory: stocked goods you intend to sell
    • Receivables: payments your clients and customers owe you
    • Cheques: a document that orders a bank to pay out money to a person's account
  • Fixed assets: assets which are purchased for long-term use and are not likely to be converted quickly into cash within a year; these include, but are not limited to: buildings, land, machinery, vehicles, software, etc.

Liabilities

"How much do I owe?"

Liabilities refer to any debts the entity has. They are represented as a credit balance. Liabilities are divided into 3 categories:

  • Current liabilities: any debts that you owe within the next 12 months
    • Taxes: a debt owed to a taxing authority; these include, but are not limited to income tax, sales tax, and capital gains tax
    • Credit cards: a debt owed to the bank through the medium of a scannable card
    • Salaries and wages payable: agreements of payment to employees as a form of debt
    • Short-term loans: loans taken from an institution to be paid within the year
    • Overdrafts: a deficit in a bank account allowed by a bank to draw more money than the account holds
  • Non-current liabilities: long-term debt that goes beyond 12 months
    • Long-term loans: loans with repayment terms usually longer than five years
    • Mortgages: a loan to purchase or maintain real estate from a financial institution
  • Contingent liabilities: liabilities that may occur depending on the outcome of a future event
    • Lawsuits: a claim or dispute brought to the court of law
    • Product warrenties: a guarantee a manufacture or similar party regarding the condition of the product

Equity

"How much is left over?"

If we follow the equation for net worth, assets minus liabilities would give us our total equity. However, equity from the perspective of a transaction refers to the value of something. Say, for instance, when you start a ledger, there was $100 in your checking account. Where will that money come from? The answer is your equity.

If you have a kidney worth $262,000, then you have $262,000 in equity in that kidney. To convert the kidney (a commodity) into cash or to credit your bank account, you will have to debit your kidney by selling it.

[!INFO]

Types such as expenses, revenue, and income are considered subcategories of equity.

There are quite a lot of subcategories of equity. This includes, but is not limited to:

  • Expenses: the cost of money spent on something
  • Revenue: money received generated from business operations
  • Income: money received from an agreement, either through work or investment

Equity also reflects all kinds of assets that have not been debited as assets. In this case, equity is represented as a credit balance.


Terminology

Basis for comparisonDebitCredit
MeaningRefers to a record of money flowing into an accountRefers to a record of money flowing out of an account

In accounting, every financial transaction of an entity is kept inside a journal. The entries inside the journal are used to create a general ledger. The differences between them are listed in the table below:

Basis for comparisonJournalLedger
MeaningThe book which records all financial transactions of an entityThe book that contains financial information needed to make
Known asBook of original entryBook of secondary entry
PurposeUsed in preparation of a ledgerUsed for labelling balances for final accounts
Transactions RecordedAll entries are made in chronological orderEntries are organized by account
Debit and creditCan be separated by columns or by entriesThe left side of a ledger is often the debit side while the right side is credit
Narration (comment or description)RequiredNot required
BalancingBalancing is not doneAll accounts are balanced based on the 5 main accounting types
GranularityOffers the highest granularity as all transactions are recordedOffers little granularity in comparison as it only shows account data

Appendix

hledger for personal use

hledger is a multi-currency double-entry accounting software that is accessible through the command-line/terminal. It is mostly inspired by ledger-cli, but rewritten in Haskell with build support for M1 Mac machines.

$ hledger -f transactions.journal balance -t
            3113 USD  Assets:Bank
           -2993 USD  Equity
            2157 USD    Expenses
            2000 USD      Electronics
              20 USD      Marketing
             135 USD      Web
           -5000 USD    Opening Balance
            -150 USD    Revenue
            -120 USD  Liabilities
            -135 USD    Credit Card
              15 USD    Taxes:Sales
--------------------
                   0
## journal
2020-01-01 Opening Balance
    Assets:Bank                          0 USD
    Equity:Opening Balance               0 USD

2020-01-05 Initial Investment
    Assets:Bank                   5000 USD
    Equity:Opening Balance       -5000 USD

2020-01-09 MacBook purchase
    Equity:Expenses:Electronics        2000 USD
    Assets:Bank                       -2000 USD

2020-01-11 Domain Registration (1 year)
    Equity:Expenses:Web              35 USD
    Liabilities:Credit Card         -35 USD

2020-01-14 Web Hosting Fees (1 year)
    Equity:Expenses:Web             100 USD
    Liabilities:Credit Card        -100 USD

2020-01-16 Advertising Expense
    Equity:Expenses:Marketing          20 USD
    Assets:Bank                       -20 USD

2020-01-18 Product Sales
    Assets:Bank             50 USD
    Equity:Revenue         -50 USD

2020-01-20 Bank Fees
    Equity:Expenses           2 USD
    Assets:Bank              -2 USD

2020-01-23 Product Sales
    Assets:Bank            100 USD
    Equity:Revenue        -100 USD

2020-01-23 Sales tax
    Liabilities:Taxes:Sales          15 USD
    Assets:Bank                     -15 USD

Reference