Saving & investing

Minimum Variance Portfolio Calculator

Supply an annual covariance matrix to find an allocation with the lowest variance under long-only weights. The tool does not estimate market inputs or recommend assets.

Runs privately in your browserMethod reviewed

Your numbers

2–8 rows, one comma-separated row per asset. Decimal-return variance units: 20% volatility gives 0.04 on the diagonal. Same asset order throughout.
Your figures stay on this device.

How the calculation works

This tool asks a narrow allocation question: which non-negative weights minimise variance for the covariance matrix entered? It does not need expected returns and therefore cannot decide whether the resulting expected reward is attractive.

Minimise wᵀΣw subject to sum(w)=1 and w≥0. Every possible active asset subset is checked; the supplied matrix must be symmetric and positive semidefinite.
  1. Validate the risk inputs

    The matrix must be symmetric and positive semidefinite. These conditions prevent an internally inconsistent covariance model; an invalid matrix is rejected rather than silently repaired.

  2. Search feasible allocations

    Weights must sum to one and cannot be negative. The solver checks combinations of active assets so an asset may receive a zero weight at the optimum.

  3. Calculate combined risk

    Portfolio variance includes both individual variances and cross-asset covariances. The square root converts the resulting variance into the reported annual volatility.

Worked example: Check Portfolio variance

Sample inputs demonstrate the method. They are not a forecast or product offer.

The first example has two assets with variance 0.04 each and zero covariance. Equal half-weights produce variance 0.25 × 0.04 + 0.25 × 0.04 = 0.02, lower than either asset held alone.

Annual covariance matrix
0.04,0 0,0.04

Expected result

Portfolio variance
0.02
Worked example: Check Portfolio variance

Sample inputs demonstrate the method. They are not a forecast or product offer.

Annual covariance matrix
0.01,0 0,0.04

Expected result

Portfolio variance
0.008

Understanding your result

The result is the lowest modelled variance within this long-only asset set. Adding short positions, leverage, minimum holdings or trading costs would create a different optimisation problem.

A singular matrix can permit several equally low-risk portfolios. One feasible minimiser is shown; the displayed weights need not be the only allocation with that variance.

Questions you might have

What does the result include?

Find long-only weights with the lowest variance for your supplied covariance matrix.

Which limits should I check?

Supports 2–8 assets. A singular covariance matrix can have several equally good allocations; one minimiser is reported.

Choosing the right inputs

Annual covariance matrix
Use a square matrix for two to eight assets, with rows and columns in exactly the same asset order. Enter covariance in decimal-return units. For example, a volatility of 20% corresponds to a diagonal variance of 0.04, not 20 or 400.

Common mistakes to avoid

  • Do not paste a correlation matrix as covariance without converting using asset volatilities.
  • Annual and monthly covariance estimates cannot be mixed within the same matrix.

Assumptions to check

  • Supports 2–8 assets. A singular covariance matrix can have several equally good allocations; one minimiser is reported.
  • All calculations run on your device. Figures are scenarios based on your inputs, not investment recommendations.

Sources and method

Read our calculation and testing approach.