iLearnFintech Glossary Formulas Cases Sandboxes
Banking/How banks work

Net interest margin

9 min readCoreUpdated December 2026
In short

Net interest income is what a bank earns on loans and bonds minus what it pays on deposits and borrowing. Divided by the assets that earn interest, it gives the net interest margin, usually 1–3%. It depends on the mix of loans and funding, on competition and on the level of interest rates.

What it is

Net interest income (NII) is interest income minus interest expense. For most commercial banks it is more than half of total income.

The net interest margin (NIM) is NII divided by average interest-earning assets. A close cousin is the spread: the average yield on assets minus the average cost of the liabilities that pay interest. NIM is usually a little higher than the spread, because part of the assets is funded by equity and other money that costs no interest.

What drives the margin:

  • Asset mix: consumer loans and cards earn far more than mortgages or government bonds, but they also lose more.
  • Funding mix: current accounts that pay little or nothing are the cheapest money; bonds and interbank borrowing the dearest.
  • Competition: in a crowded market, loan rates are pushed down and deposit rates up.
  • The level of interest rates: when the central bank raises its rate, banks raise loan rates faster than deposit rates. The share of a rate change passed on to depositors is the deposit beta. A low beta widens the margin as rates rise. Near zero it works the other way: ordinary savers won't accept rates much below zero, so lower rates squeeze the margin.
  • Timing: fixed-rate loans and bonds reprice only when they mature, so a rate change takes years to pass through. That is interest rate risk, covered in its own lesson.

A high NIM is not automatically good. It may just be payment for risk: a card lender with an 8% margin and 7% losses keeps less than a mortgage bank with a 1.5% margin and 0.1% losses. Always read NIM next to the cost of risk.

The intuition

Think of a shop's gross margin: buy at one price, sell at a higher one. A bank buys money from depositors and lenders and sells it to borrowers. Unlike a shop, part of its raw material, money on current accounts, costs almost nothing. That free money is worth most when interest rates are high, and almost nothing when they are zero.

0%1%2%3%−1%0%1%2%3%4%5%Today: 2.5%Zero rates: 0.9%At −0.5%: 0.5%Policy rateNet interest margin
Harbour's net interest margin at different policy rates, in a simple model. Every asset reprices at once, while deposit rates move by 40–70% as much and never go below zero. Below zero the margin falls faster than it would if deposit rates could go negative (dashed).

The math

\[\text{NII} = \sum_i r_i A_i - \sum_j c_j L_j\]
\[\text{NIM} = \frac{\text{NII}}{\text{Average interest-earning assets}}\]
\[\Delta r_{\text{deposit}} = \beta \times \Delta r_{\text{policy}}\]

Where

\(r_i,\ A_i\)
Interest rate on, and amount of, each kind of asset
\(c_j,\ L_j\)
Interest rate on, and amount of, each kind of funding
\(\beta\)
Deposit beta: the share of a change in the policy rate passed on to depositors

In words: Add up what each asset earns, subtract what each source of funding costs, and divide by the assets that earn interest. With a deposit beta below one, part of every rate rise stays with the bank.

An example

Harbour Bank, with the central bank's rate and SOFR at 3.5%:

$ billionsRateInterest
Cash and reserves83.0%0.240
Government bonds173.0%0.510
Mortgages454.5%2.025
Corporate loans225.5%1.210
Consumer loans58.8%0.440
Interest income974.56%4.425
Retail deposits501.4%0.700
Corporate deposits202.45%0.490
Wholesale funding184.5%0.810
Interest expense882.27%2.000
Net interest income2.425

NIM = 2.425 ÷ 97 = 2.50%. The spread is 4.56% − 2.27% = 2.29%. The difference comes from the $9 billion of interest-earning assets funded by equity and other money that pays no interest.

Retail deposits pay 40% of the policy rate and corporate deposits 70%. If the policy rate falls to 0.5% and every asset reprices with it, the margin drops to 1.11%. At −0.5%, the kind of rate Denmark lived with for years, it falls to 0.47%, because deposit rates are already at zero and can't follow.

In Python

Rebuild Harbour's interest income and expense line by line, then move the policy rate and watch the margin, with and without the zero floor on deposit rates.

# Harbour Bank, $ billions: (amount, spread over the policy rate in %)
assets = {"cash and reserves": (8, -0.5), "government bonds": (17, -0.5), "mortgages": (45, 1.0),
          "corporate loans": (22, 2.0), "consumer loans": (5, 5.3)}
deposits = {"retail": (50, 0.4), "corporate": (20, 0.7)}      # (amount, deposit beta)
wholesale = (18, 1.0)                                         # (amount, spread over the policy rate)
earning = sum(a for a, s in assets.values())                  # 97

def nim(policy, floor=True):
    income = sum(a * (policy + s) for a, s in assets.values())
    paid = sum(d * (max(b * policy, 0) if floor else b * policy) for d, b in deposits.values())
    expense = paid + wholesale[0] * (policy + wholesale[1])
    return income / 100, expense / 100, (income - expense) / earning

income, expense, m = nim(3.5)
print(f"policy 3.5%: income {income:.3f}, expense {expense:.3f}, NII {income - expense:.3f}, NIM {m:.2f}%")
for p in [5.0, 2.0, 0.5, 0.0, -0.5]:
    print(f"policy {p:+.1f}%: NIM {nim(p)[2]:.2f}%  (if deposit rates could go negative: {nim(p, floor=False)[2]:.2f}%)")

In the real world

Jyske Bank and negative rates, 2019

In July 2012 Denmark's central bank cut one of its rates below zero for the first time in its nearly 200-year history. Its key rate stayed mostly negative for the next decade. Banks paid to keep money at the central bank, while most savers still got 0%. In August 2019 Jyske Bank, one of Denmark's largest banks, made headlines by offering ten-year loans at −0.5%. The same month it reported net interest income 7% lower than a year earlier, and its chief executive called private customers' deposits a large deficit. Jyske became the first Danish bank to announce negative rates for household deposits, starting with very large balances in December 2019. Other banks followed, and the thresholds were later cut to 100,000–250,000 kroner. The zero floor on deposit rates is what squeezes margins when rates go below zero.

Think about it

A rival bank reports a NIM of 4.5%, almost twice Harbour's 2.5%. Harbour's board asks why Harbour can't do the same. What would you look at?

Show a model answer

First the loan mix: a bank with many cards and consumer loans earns more per dollar but also loses more, so compare NIM minus the cost of risk. Then the funding: does the rival have more current accounts that pay nothing? Then the rate exposure: is its margin high because of recent rate rises that may reverse? Finally costs: a high margin with high costs may still give a lower return on equity. Harbour shouldn't copy a margin without the risk behind it.

Reading the result

Follow NIM over time and against similar banks, and ask why it moved: the loan mix, the cost of funding or the rate level. Then subtract the cost of risk before calling a margin good.

Good signs

  • Cheap, stable deposits that keep funding costs down
  • A margin that still looks good after loan losses
  • Knowing how much of the margin depends on the rate level

Watch out

  • Chasing margin with riskier loans
  • Treating a margin boost from rising rates as permanent
  • Comparing NIM across banks with very different loan books

Remember

  • NII = interest earned − interest paid; NIM = NII ÷ interest-earning assets.
  • Deposit betas below one widen margins when rates rise.
  • Near zero, deposit rates hit a floor and margins shrink.

Check yourself

Question 1 of 2A bank has interest-earning assets of $50 billion, interest income of $2.5 billion and interest expense of $1.5 billion. What is its NIM?

Question 2 of 2The central bank raises its rate by 2 percentage points. A bank's deposit beta is 0.3. How much does its deposit rate rise?

Read more

  • Frederic S. Mishkin, The Economics of Money, Banking and Financial Markets: chapter on banking and the management of financial institutions
  • John C. Hull, Risk Management and Financial Institutions: chapter on interest rate risk

Spotted a mistake or have a wish?

Tell us in a line or two. The page name is sent along automatically.