LinuxCommandLibrary

hledger-balancesheet

Display balance sheet report

TLDR

Show the current balances in Asset and Liability accounts, excluding zeros

$ hledger [[bs|balancesheet]]
copy

Show just the liquid assets (Cash account type)
$ hledger [[bs|balancesheet]] type:C
copy

Include accounts with zero balances, and show the account hierarchy
$ hledger [[bs|balancesheet]] [[-E|--empty]] [[-t|--tree]]
copy

Show the balances at the end of each month
$ hledger [[bs|balancesheet]] [[-M|--monthly]]
copy

Show the balances' market value in home currency at the end of each month
$ hledger [[bs|balancesheet]] [[-M|--monthly]] [[-V|--market]]
copy

Show quarterly balances, with just the top two levels of account hierarchy
$ hledger [[bs|balancesheet]] [[-Qt|--quarterly --tree]] [[-2|--depth 2]]
copy

Same as above above, and generate HTML output in bs.html
$ hledger [[bs|balancesheet]] [[-Qt|--quarterly --tree]] [[-2|--depth 2]] [[-o|--output-file]] bs.html
copy

SYNOPSIS

hledger balancesheet [OPTIONS] [ACCOUNT_REGEX...]

PARAMETERS

-f FILE, --file=FILE
    Specifies the ledger data file to process.

-b DATE, --begin=DATE
    Sets the start date for transactions to consider. For a balance sheet, transactions up to this date are generally included.

-e DATE, --end=DATE
    Sets the 'as of' date for the balance sheet. All transactions up to and including this date are included in the calculation.

-p PERIOD, --period=PERIOD
    Defines the time period for the report. For balance sheets, this implicitly sets the end date.

-V, --value
    Converts all amounts to a single commodity, useful for multi-currency ledgers to get a unified total.

-s, --show-empty
    Includes accounts with a zero balance in the report. By default, these are hidden.

-S, --sort-accounts
    Sorts accounts alphabetically by their full name.

-E, --exact
    Matches account names exactly by the provided regular expressions, without implicitly including sub-accounts.

--depth=N
    Limits the display of hierarchical accounts to a specified depth N.

--layout=LAYOUT_FILE
    Uses a custom report layout defined in a separate file for structured output.

--flat
    Suppresses the hierarchical indentation of accounts, displaying them on a single level.

--pivot=FIELD
    Groups or pivots the report by a specific transaction field (e.g., 'tag', 'payee').

-O FORMAT, --output-format=FORMAT
    Specifies the output format (e.g., 'text', 'csv', 'json').

-o FILE, --output-file=FILE
    Redirects the report output to a specified file instead of standard output.

[ACCOUNT_REGEX...]
    One or more regular expressions to filter which accounts are included in the report.

DESCRIPTION

The hledger-balancesheet command, a core subcommand of the hledger plain text accounting system, generates a balance sheet report. This report provides a financial snapshot at a specific point in time, detailing an entity's assets (what it owns), liabilities (what it owes), and equity (the residual value or net worth).

It is an essential tool for understanding the financial health of your ledger, allowing users to assess their financial position on any given date. The command supports various filtering options by date, account, and commodity, and allows for custom formatting and layout to suit diverse reporting needs. It aligns with the fundamental accounting equation: Assets = Liabilities + Equity.

CAVEATS

A balance sheet is a snapshot in time; running it on different dates will yield different results. Its accuracy is entirely dependent on the completeness and correctness of the underlying ledger data. For multi-currency ledgers, the --value option is often necessary to get a meaningful total, as hledger does not automatically convert currencies without explicit instruction.

FUNDAMENTAL ACCOUNTING EQUATION

The hledger balancesheet command implicitly represents the fundamental accounting equation: Assets = Liabilities + Equity. Assets are what you own, Liabilities are what you owe, and Equity is the residual value (your net worth). The report structure is designed to clearly show this relationship, providing a clear picture of financial position.

TIME SENSITIVITY

Unlike an income statement which covers a period, a balance sheet is strictly 'as of' a specific date. If no date is specified with -e or -p, it defaults to the current date, showing the financial position at the end of the last recorded transaction on or before today.

HISTORY

hledger is a free software accounting system that tracks money and commodities using plain text data files, inspired by the original ledger program. Development began in 2007 by Simon Michael, written in Haskell, with goals of simplicity, user-friendliness, and extensibility. The balancesheet subcommand has been a fundamental component since early versions, providing core financial reporting alongside income/expense statements. Its design has evolved to support various filtering, formatting, and custom layout options, reflecting the growing needs of its user base.

SEE ALSO

hledger(1), hledger-incomeflow(1), hledger-cashflow(1), hledger-register(1), hledger-print(1), ledger(1)

Copied to clipboard