Measuring portfolio concentration risk
Counting holdings is not measuring diversification. A portfolio can hold thirty stocks and still behave like it holds four. This guide covers the three numbers that actually describe concentration — maximum position weight, the Herfindahl-Hirschman Index, and the effective number of positions — how to compute each, and where each one misleads you.
Why counting holdings fails
The intuition that more holdings means less risk is roughly right and precisely useless. Consider two portfolios, both holding ten stocks. The first splits capital evenly, ten percent each. The second holds sixty percent in one name and spreads the remaining forty percent across nine others.
Both have a holding count of ten. The first is genuinely diversified; the second is a bet on one company with some decoration attached. Any metric that returns the same answer for both is not measuring what you care about.
What you actually want to know is how much of the portfolio's outcome depends on how few decisions. That requires weighting.
Maximum position weight
The simplest useful measure: what fraction of total value sits in the single largest holding.
max_weight = max(valuei) / Σ valuei
This is worth checking first because it catches the most dangerous failure mode instantly. If one position is forty-five percent of the portfolio, nothing else in your analysis matters much — that single holding will dominate returns, drawdowns, and volatility regardless of how elegant the rest of the allocation looks.
Its weakness is that it only sees one position. A portfolio with five holdings at twenty percent each has a maximum weight of twenty percent, which sounds reasonable, and yet it is far more concentrated than the number suggests. For that you need a measure that accounts for the whole distribution.
The Herfindahl-Hirschman Index
The HHI comes from antitrust economics, where regulators use it to measure how concentrated an industry is among its competitors. The same mathematics applies cleanly to a portfolio: square every weight, then sum the squares.
HHI = Σ wi² where wi = valuei / total value
Squaring is what makes this work. It penalises large weights disproportionately — a position at
forty percent contributes 0.16 to the sum, while four positions at ten percent each
contribute only 0.04 combined, despite representing the same total capital.
Small positions become almost invisible, which is correct, because they are.
The index is bounded in a useful way:
| Portfolio | HHI | Reading |
|---|---|---|
| Single holding | 1.00 | Maximum concentration |
| Two holdings, equal | 0.50 | Highly concentrated |
| Ten holdings, equal | 0.10 | Moderately diversified |
| Fifty holdings, equal | 0.02 | Broadly diversified |
The pattern is visible: for N equally weighted holdings, HHI equals
1/N. That relationship is what makes the next metric possible.
Effective number of positions
HHI is mathematically clean but hard to feel. An HHI of 0.3877 conveys nothing intuitively. Invert it and the meaning appears immediately.
Neffective = 1 / HHI
This answers a genuinely useful question: how many equally weighted positions would produce the same concentration as what you actually hold? A portfolio of thirty names with an effective count of six is telling you, unambiguously, that it behaves like a six-stock portfolio. The other twenty-four holdings are noise.
Statisticians will recognise this as the inverse Simpson index, used in ecology to measure species diversity. It is the same calculation applied to a different kind of population — and the interpretation carries over exactly.
A worked example
Take a three-position technology portfolio:
| Holding | Value | Weight | Weight² |
|---|---|---|---|
| AAPL | $25,000 | 45.45% | 0.2066 |
| MSFT | $22,000 | 40.00% | 0.1600 |
| NVDA | $8,000 | 14.55% | 0.0212 |
| Total | $55,000 | 100% | 0.3877 |
HHI is 0.3877, so the effective number of positions is 1 / 0.3877 = 2.58. The
portfolio holds three names but behaves like it holds about two and a half — NVDA, at under
fifteen percent, contributes very little to the overall risk profile.
Maximum position weight is 45.45 percent, which on its own is already a warning. Together the two numbers tell a consistent story: this is a concentrated bet, and adding NVDA did not meaningfully change that.
The concentration these metrics miss
Here is the trap. Every metric above treats holdings as independent. They are not.
The portfolio in the example is one hundred percent technology. Even if you rebalanced it to three perfectly equal positions — pushing the effective count to a healthy 3.0 and dropping max weight to 33 percent — it would remain a single undiversified bet on one sector's fortunes. Position-level metrics would improve while the actual risk barely moved.
Genuine concentration analysis therefore has to look at least three levels deep:
- Position level — max weight, HHI, effective positions
- Sector level — the same calculations applied to sector groupings rather than individual tickers
- Factor level — whether holdings share exposure to the same underlying drivers, such as rates sensitivity, momentum, or a single currency
The third level is where most analysis stops short, and where the real surprises live. Two stocks in different sectors can be far more correlated than two in the same sector if they respond to the same macro factor. A portfolio can look diversified across every sector and still be a leveraged bet on falling interest rates.
Computing this via API
These calculations are simple enough to implement yourself — HHI is three lines of code. The part that is genuinely hard is everything downstream: resolving tickers to sectors and factor exposures, keeping that reference data current across markets, and translating the numbers into a judgement.
The PORTIQA API returns all three concentration metrics alongside sector and factor analysis from a single request:
curl -X POST https://portiqa.ai/evaluate \
-H "Authorization: Bearer $PORTIQA_KEY" \
-H "Content-Type: application/json" \
-d '{
"risk_level": "medium",
"positions": [
{ "ticker": "AAPL", "market_value": 25000 },
{ "ticker": "MSFT", "market_value": 22000 },
{ "ticker": "NVDA", "market_value": 8000 }
]
}'
The relevant fields in the response:
{
"score": 45.9,
"status": "Neutral",
"max_position_weight": 45.45,
"max_position_ticker": "AAPL",
"effective_positions": 2.58,
"top_sector": "Technology",
"top_sector_weight": 100,
"score_components": {
"diversification": 34.5,
"risk": 99.2,
"quality": 72.1
}
}
Note the disagreement between two components, because it is instructive. The
risk component scores 99.2 — these are large, stable, high-quality companies with
low individual volatility. The diversification component scores 34.5, because all
that quality is concentrated in one sector. A single blended score would have hidden the
tension; separated components show you exactly which problem to solve.
Full field documentation is in the API reference, and implementation snippets for Python, JavaScript, and PHP are in code examples.
Evaluate a real portfolio
Five free evaluations per month, same engine as every paid plan. One endpoint, no setup beyond an API key.
Get a free API key