Portfolio Analysis Tool

Free Portfolio Correlation Matrix

Import aligned decimal return series to inspect sample Pearson correlations and per-period statistics. Missing or constant data are not treated as zero correlation; historical relationships are not forecasts.

CSV & JSON Support
Interactive Heatmap
No Sign-Up Required

Upload Returns Data

Importing a valid file replaces the displayed dataset. Export Returns first to keep a backup. Invalid imports preserve it. File limit: 2 MiB; 2–30 assets and 2–5,000 aligned periods.

Required Format

CSV Format:

Date,AAPL,MSFT,GOOGL
2025-01,0.05,-0.02,0.03
2025-02,0.03,0.04,0.02

JSON Format:

[
  {"AAPL":0.05,"MSFT":-0.02},
  {"AAPL":0.03,"MSFT":0.04}
]

Returns as decimals (0.05 = 5%)

Add Asset Manually

Build a correlation matrix from aligned returns

Each row must represent the same interval for every asset. Use one frequency and return convention, such as monthly total returns in a common currency. Prices are not returns. This tool does not convert prices, adjust dividends or align separate calendars automatically.

CSV files require a Date, Period or Time first column. JSON may omit that field, in which case rows receive ordinal labels. Names must be distinct, dates or period labels must be unique, and every cell must contain a finite decimal number. Missing cells reject the import rather than shifting later values into the wrong periods.

Inspect the calculation

Pearson correlation is Σ[(x − mean x)(y − mean y)] divided by the square root of Σ(x − mean x)² × Σ(y − mean y)². The NIST correlation reference describes this coefficient. A constant series has zero variance, so its coefficient is undefined, including its self-correlation.

The heatmap displays each value directly; color is supplementary. Rankings sort defined pairs by absolute correlation. Strength labels are display heuristics, not statistical significance tests. The summary uses arithmetic mean and sample standard deviation (n − 1) per supplied period, with no annualization.

Interpret a sample without making a forecast

Positive values describe a tendency to move together linearly in this sample; negative values describe the opposite tendency. A value near zero can coexist with nonlinear dependence. The coefficient says nothing by itself about the size of price moves, expected return or a suitable hedge ratio.

With only two nonconstant observations, correlation is mechanically +1 or −1. More observations do not guarantee stability: outliers, changing market conditions and the chosen window matter. Review the underlying data and compare windows before using correlation as one input to a broader risk assessment.

Keep a copy of your inputs

File parsing and calculation run in the browser; this tool does not send the uploaded returns to an analysis API. It attempts to save data in local storage, which can be unavailable or cleared by browser settings. Export Returns preserves the input table, and Export Matrix saves coefficients with N/A for undefined cells. CSV labels are quoted and formula-like labels are prefixed for spreadsheet safety.

The tool is available without sign-up or a tool fee. It does not select assets, optimize weights or execute trades. Historical negative correlation does not establish a reliable future hedge.

Frequently Asked Questions

What does Pearson correlation measure?

Pearson correlation describes the linear association between two aligned return series in this sample. Values range from −1 to +1. Zero means no linear association, not independence, no risk or guaranteed diversification. Correlation is undefined for a constant series and is shown as N/A.

What data can I import?

Use 2–30 assets and 2–5,000 aligned periods, up to 2 MiB per file. CSV needs a Date, Period or Time column followed by distinct asset columns. JSON needs row objects with identical keys and an optional date, period or time field. Blank or invalid cells reject the entire import; existing data remain unchanged.

How should I express returns?

Use decimals consistently: 0.05 means 5%. Use the same dates, frequency, currency convention and price-return or total-return definition for every asset. The tool preserves row alignment; it does not calculate returns from prices, repair missing observations or fetch market data.

Can I enter assets manually?

Yes. Enter a distinct name and comma-separated decimal returns with exactly the same row count as the current data. You must align their periods yourself; matching counts alone do not prove dates match. Two observations can mechanically give ±1, so very short samples are not evidence of a stable relationship.

Where are my data stored?

This calculator reads files and computes correlations in the browser, and attempts to save the dataset in this browser’s local storage. Storage failures are shown. Export Returns provides a backup; Clear All clears displayed data and attempts to remove this tool’s saved data. This does not describe the privacy behavior of the whole website.

Are the example returns historical data?

No. The downloadable and loadable DEMO series are invented format examples. They do not represent the historical performance of any security. Loading the example replaces the displayed dataset, so export any current work first.

Does a negative correlation establish a hedge?

No. Historical correlation can change, especially under stress. Hedge size also depends on volatility, exposure, liquidity and costs. The tool does not choose weights, test hedge performance or forecast future returns.

Explore the Rules Behind a Trading Idea

Use Pineify’s Coding Agent to draft and review a separate Pine Script idea. This matrix is not connected to the agent or to an execution system; a historical correlation does not establish a profitable strategy.