Cross Correlation Calculator
Enter two sequences and a lag to get their cross-correlation.
Result
How it is calculated
For a whole-number lag k the tool pairs xi with yi+k, using only the pairs where both values exist, and then computes the Pearson coefficient on those pairs: r = Σ(x − x̄)(y − ȳ) ÷ √(Σ(x − x̄)² × Σ(y − ȳ)²). A positive lag means Y is delayed relative to X, and a negative lag means Y comes earlier. The number of pairs is shown, and it shrinks as |lag| grows. Enter each series as numbers separated by spaces, commas, semicolons or tabs, with at least 2 values each; any non-numeric item, fewer than 2 pairs, or a series with no variation returns nothing. The lag is rounded to the nearest integer, and a blank lag counts as 0. The result is between −1 and 1 and is shown to four decimals.
Worked example
X = 2 5 3 8 4 7 6 9 and Y = 1 5 11 7 17 8 15 12, with lag 1. The pairs are (2,5), (5,11), (3,7), (8,17), (4,8), (7,15) and (6,12), so there are 7 pairs. Their means are 5 for X and about 10.71 for Y. The coefficient comes to 0.9937, which says Y follows X by one step almost perfectly. At lag 0 the same data give only 0.2204, so the delay is what reveals the relationship.
Common mistakes
- Using decimal commas such as 2,5. A comma separates values, so 2,5 becomes the two numbers 2 and 5; use a decimal point.
- Reading the sign of the lag backwards. Here a positive lag compares xi with the later value yi+k, so it tests whether Y lags behind X, not the reverse.
- Using a large lag on short series. With 8 values and lag 6, only 2 pairs remain and the coefficient is almost always ±1 for no good reason; watch the pairs count.
- Treating high correlation as proof that one series causes the other. It shows they move together after the shift, nothing more.
About this calculator
Cross-correlation measures how well two time series match up when one is shifted relative to the other by a chosen number of steps, or lag. This calculator computes the Pearson correlation coefficient between series X and a lagged version of series Y, testing whether values in one series tend to predict values in the other after accounting for a delay between them.
Signal processing engineers use cross-correlation to detect time delays between related signals (such as an echo or a sensor offset), while economists and time-series analysts use it to find lead-lag relationships between related data — for example, whether a change in one economic indicator tends to precede a change in another by a certain number of periods.
Was this helpful?
You can pick up to 3 reactions.
Popular calculators
Loan Calculator
Monthly payment, total interest and full amortization schedule.
Percentage Calculator
Percent change, percent of, and ratio calculations.
Discount Calculator
Calculate final price, savings, and discount amount.
BMI Calculator
Body mass index from height and weight (metric or imperial).
Age Calculator
Compute your exact age in years, months and days from a birth date.
Compound Interest Calculator
Calculate the final amount and interest earned with compounding.
All Calculators
- Loan Calculator
- Profit Calculator
- Discount Calculator
- BMI Calculator
- Percentage Calculator
- Ideal Weight Calculator
- Age Calculator
- Pregnancy Due Date Calculator
- Compound Interest Calculator
- BMR Calculator (Basal Metabolic Rate)
- Tip Calculator
- Fuel Cost Calculator
- Date Difference Calculator
- Sleep Cycle Calculator
- Daily Water Intake Calculator
- Simple Interest Calculator
- Heart Rate Zones Calculator
- Running Pace Calculator
- Pet Age Calculator
- Calories Burned Calculator
- Macro Calculator
- TDEE Calculator (Total Daily Energy Expenditure)
- Waist-to-Hip Ratio Calculator
- Honor Roll Calculator
- One Rep Max (1RM) Calculator
- Ovulation Calculator
- Electricity Cost Calculator
- Unit Price Calculator
- Savings Goal Calculator
- Break-Even Point Calculator
- Paint Calculator
- Course Grade Average Calculator
- Business Days Calculator
- Time Duration Calculator
- Fuel Economy Calculator
- Temperature Converter
- Tile Calculator
- Aspect Ratio Calculator
- Roman Numeral Converter
- Goal Weight Timeline Calculator
- Salary Converter (Hourly to Annual)
- Credit Card Validator (Luhn)
- Body Surface Area (BSA) Calculator
- Feels-Like Temperature Calculator
- Ohm’s Law Calculator
- PPI (Pixel Density) Calculator
- Molar Mass Calculator
- Zodiac Sign Calculator (Western + Chinese)
- IBAN Validator
- Shoe Size Converter
- Country Info & Dialing Code Lookup
- Time Zone Difference (World Clock)
- CAGR (Compound Annual Growth Rate) Calculator
- Rule of 72 Calculator
- Blood Alcohol Content (BAC) Calculator
- Lean Body Mass (LBM) Calculator
- Pythagorean Theorem Calculator
- Speed Converter
- Download Time Calculator
- Date Calculator (Add/Subtract)
No calculators found
Be the first to comment.