Log return calculator

Turn a column of prices into continuously compounded (log) returns — ln(price ÷ previous price) per period, a running cumulative, the total, per-period and annualized volatility, and the equivalent simple returns. Runs entirely in your browser. Educational only, not financial advice.

Try:
Log returns

About this tool

A log return — also called a continuously compounded return, a logarithmic return, or a cc return — is ln(price ÷ previous price). It is the return convention most quantitative work is built on, because two properties that simple percentage returns lack come for free.

The first is that log returns are time-additive. Add up the daily log returns of a month and you get exactly the month's log return, so there is no chain-linking, no multiplying (1 + r) factors, and no drift when you slice a series into sub-periods. The second is symmetry: a move up and the move that exactly undoes it are +x and −x. A price that goes 50 → 70 → 50 gives simple returns of +40.00% then −28.57%, which look lopsided, while the log returns are +33.6472% and −33.6472% and sum to zero.

Paste a column of prices or index levels — closes, NAVs, exchange rates, subscriber counts, anything that only ever goes above zero — and this page computes every step. Rows may be bare numbers, or label,price pairs like 2024-01-02,187.15 so the output keeps your dates. Currency symbols ($, , £, ¥) and thousands separators are stripped for you, and a single comma-separated line such as 100, 105, 103 is treated as a series too. Everything runs in WebAssembly in your browser; no prices are uploaded anywhere.

Alongside the per-period log return you get the simple return of the same step for comparison, a running cumulative log return, the total for the whole span, the mean per period, the sample standard deviation (the per-period volatility), and both figures scaled to a year using the periods-per-year you pick. The annualized simple figure is exp(annualized log return) − 1, which is the CAGR implied by the series.

Worked example

Four monthly fund NAVs, annualized at 12 periods per year, percent units, 4 decimals:

100
105
103
108

Output:

Log returns for 4 prices → 3 returns (monthly, 12 periods/year)

first price: 100 at 1
last price:  108 at 4

total log return:        +7.6961%
same span, simple:       +8.0000%
mean log return:         +2.5654% per period
volatility (std dev):    3.8878% per period
annualized log return:   +30.7844% per year
annualized, simple:      +36.0489% per year
annualized volatility:   13.4677% per year
best period:             +4.8790% at 2
worst period:            -1.9231% at 3
positive periods:        2 of 3 (1 negative)

#  label  price  log return  simple return  cumulative log
----------------------------------------------------------
1  1        100           —              —               —
2  2        105    +4.8790%       +5.0000%        +4.8790%
3  3        103    -1.9231%       -1.9048%        +2.9559%
4  4        108    +4.7402%       +4.8544%        +7.6961%

Read the additivity straight off the table: +4.8790 − 1.9231 + 4.7402 = +7.6961, the total log return. The equivalent simple return over the same span is +8.0000%, because exp(0.076961) − 1 = 0.08.

Switch the output shape to CSV to paste the same table back into a spreadsheet as plain numeric columns, to JSON for every computed field including the per-step array, or to table for just the grid.

Options and limits

Educational only — not financial advice.

FAQ

When should I use log returns instead of simple percentage returns?

Use log returns whenever you are going to add, average, or model returns: summing sub-periods, computing a mean and standard deviation, fitting a distribution, or running a Monte Carlo. Use simple returns when you are reporting what actually happened to money over one span, or when you are weighting the returns of several holdings into a portfolio — simple returns are additive across assets, log returns are not. This page shows both columns side by side so you never have to pick blindly.

Why is the total log return smaller than the simple return?

Because ln(1 + r) is always less than r for positive r, and the gap widens as the move gets bigger. In the worked example above, +8.0000% simple is +7.6961% in log terms. They are the same underlying move written in two conventions, and exp(log return) − 1 converts back exactly. For small moves the two are nearly identical, which is why day-to-day log returns look so much like percentages.

What does "periods per year" actually change?

Only the two annualized lines and the frequency label in the header. The mean log return is multiplied by the number you pick, and the volatility is multiplied by its square root. Nothing per-period changes. Pick 252 for daily rows from a market that trades on business days, 365 for calendar-daily data such as crypto or exchange rates, and 52, 26, 12, 4, or 1 for weekly, biweekly, monthly, quarterly, or annual rows.

My data has a zero or a negative value and the tool refuses it. What now?

That is intentional: ln(price ÷ previous price) is undefined unless both prices are strictly positive, so a zero would give -inf and a negative would give NaN. The error names the offending row so you can find it. If the zero is a missing quote from a holiday or a data outage, delete that row or carry the previous price forward. If your series genuinely crosses zero — a P&L curve, a net position, a spread — log returns are the wrong tool for it; work with differences instead.

Can I paste a whole spreadsheet column with dates, headers and currency symbols?

Yes. Copy the two columns straight out of the sheet: tab, comma, and semicolon are all accepted between the label and the price, $, , £, ¥, , , quotes, and thousands separators are stripped, and blank lines are dropped. If the first row is a header like date,close, tick First line is a header row. Rows without a label are numbered 1, 2, 3, … in the output instead.

How is the volatility computed, and why does mine differ from another tool's?

It is the sample standard deviation (dividing by n − 1) of the per-period log returns, then multiplied by √periods_per_year to annualize. Two common sources of disagreement: some tools use the population formula (n), which reads slightly lower on short series, and some compute the standard deviation of simple returns rather than log returns. There is also no mean-subtraction variant here — this is the plain sample standard deviation about the sample mean.

Developer & Automation Access

Run it from the terminal

Same engine as this page, headless — via the gizza CLI:

gizza tool log-return-calculator "2024-01-02,187.15
2024-01-03,184.25
2024-01-04,181.91"

New to the CLI? Get gizza →

Open it by URL

Pre-fill and auto-run this tool with query parameters — the names match the API/CLI:

https://gizza.ai/tools/log-return-calculator/?prices=2024-01-02%2C187.15%0A2024-01-03%2C184.25%0A2024-01-04%2C181.91&has_header=true&periods_per_year=252&unit=percent&decimals=4&output=summary

Machine-readable descriptor: tool.json — title + parameters JSON Schema for agents.