Bollinger Bands Calculator

Middle band (period average)—
Upper band—
Lower band—
Bandwidth—

How Bollinger Bands Calculator is calculated: Middle band = average of the last 20 closes; upper = middle + 2 × standard deviation; lower = middle − 2 × standard deviation

What is a Bollinger Bands calculator?

Bollinger Bands turn a price chart into a channel. The middle band is a moving average of the recent price, and the upper and lower bands sit a set number of standard deviations above and below it. When the price is calm, the bands narrow; when it swings, they widen. Traders read that channel in two ways: a price touching the upper band is running hot, a price touching the lower band is running cold, and a sudden narrowing of the bands — the squeeze — often comes before a big move in either direction. This calculator builds the bands from a list of closing prices you paste in, using the classic 20-day period and two standard deviations, and it shows the bandwidth as well, so you can see at a glance whether the market is calm or restless.

The job it does is simple to describe: give it a list of closing prices, the period and the number of standard deviations and it works out the upper, middle and lower bands plus the bandwidth for you. No spreadsheet, no formulas to remember, no sign-up. The calculation runs entirely in your browser, so you can change a number and watch the answer move at once. That quick feedback is what makes a bollinger bands calculator useful: it turns a vague hunch into a number you can compare.

The bands are used on shares, indices, commodities and currencies, on every timeframe from minutes to months. They describe volatility, not direction: a price can walk along the upper band for weeks in a strong uptrend, and a touch of a band is not by itself a signal to buy or sell. Bollinger Bands are a technical indicator, not a forecast and not investment advice. They describe how far the price has moved from its recent average; they do not say where it will go next, and no band touch should be the sole reason for a trade.

How Bollinger Bands are calculated

The calculation has three steps. First, take the average of the last 20 closing prices — that is the middle band. Second, work out the standard deviation of those same 20 prices, which measures how spread out they are. Third, add twice that standard deviation to the average for the upper band and subtract twice for the lower band. The bandwidth is the distance between the upper and lower bands, expressed as a percentage of the middle band, so it can be compared across different prices and different stocks.

The formula behind it is Middle band = average of the last 20 closes; upper = middle + 2 × standard deviation; lower = middle − 2 × standard deviation. Two standard deviations is the classic choice because, for prices that move roughly normally, about 95% of closes fall inside the bands. That is a property of the maths, not a promise about the market: real prices have fatter tails, so breaks outside the bands happen more often than the textbook 5%.

The main input is the list of closing prices, oldest first, separated by commas, spaces or new lines. You need at least as many prices as the period — 20 by default — and more is better, though only the most recent 20 are used for the bands. The period and the multiplier can be changed, but 20 and 2 are the standard settings and the ones most published charts use. Bands describe the path of a price, so the stock return calculator is the natural companion: it says what that path actually earned.

Bandwidth: what the width of the bands tells you

Bandwidth is the number most users ignore, and it is the one that says the most about the market. It is the width of the channel as a percentage of the middle band, so a bandwidth of 5% means the bands span 5% of the price, while 15% means a much wider, wilder market. Because it is a percentage, you can compare bandwidth across stocks at very different prices, which you cannot do with the rupee gap between the bands.

A low bandwidth means the price has been moving in a tight range, and that is often the calm before a move. Traders call a very narrow bandwidth a squeeze, and they watch for the breakout that usually follows — up or down, the squeeze itself does not say which. A high bandwidth means the price has been swinging hard, and new positions taken then carry more risk per rupee.

Watch bandwidth over time rather than on a single day. Paste in a fresh set of prices each week and note whether the bandwidth is rising or falling. A bandwidth that has doubled in a month tells you the market has changed character, and a trading approach that worked in the calm stretch may not work in the wild one.

A worked example: bands on 40 closing prices

The default prices on this page are 40 daily closes of a share drifting upward, from 102 to 150. The calculator uses the most recent 20 of them for the bands, with the classic 20-day period and two standard deviations.

With the default inputs — period (days) 20, standard deviations 2 — the calculator gives middle band (period average) 133.70, upper band 150.95, lower band 116.45, bandwidth 25.81%. The middle band is the average of those last 20 closes. The standard deviation measures how spread out they are, and the upper and lower bands sit two standard deviations above and below the average. The bandwidth then expresses the width of that channel as a percentage of the middle band.

In a steady uptrend like this one, expect the price to sit near or above the middle band and the bandwidth to be modest, because the daily moves are small next to the price level. Now try a choppier series — paste in prices that jump up and down by several rupees — and watch the bandwidth widen and the bands spread apart. That contrast is the whole point of the tool: the same average can hide a calm market or a wild one, and the bands show which one you are in.

Who uses Bollinger Bands?

A trader uses the bands to read volatility at a glance. A price hugging the upper band in a rising market tells them the move is strong; a price crossing from the upper band to the lower one tells them momentum has flipped. A squeeze — bands pinched tight — is their cue to watch for a breakout and to size the next trade for a bigger move.

An investor uses the bands as a background check on a holding. A stock whose bands have been widening for a month is a more volatile holding than it was, whatever the price has done. That matters for position sizing and for deciding whether a dip is a buying chance or a warning. The bands are built on one number, the standard deviation, and the standard deviation calculator explains that number on its own, with any list of values.

A student uses the bands to learn what standard deviation means in practice. The middle band is an average, the outer bands are the average plus or minus two standard deviations, and the price bouncing between them makes an abstract statistics concept visible on a chart.

Bollinger Bands vs a plain standard deviation

Bollinger Bands and a plain standard deviation are the same maths viewed two ways — one as a number, one as a picture. For the long-run picture behind the bands, the CAGR calculator turns the whole price move into one yearly growth rate.

A standard deviation on its own is a single figure: the recent closes of this share are spread out by, say, 8 rupees. Useful, but hard to judge without context — 8 rupees is a lot for a 100-rupee share and nothing for a 5,000-rupee one. The bands put that figure on the chart, scaled to the price, so you can see it. The bands also add the average. A standard deviation alone says nothing about where the price sits; the bands show the price against its own recent average, which is what turns a volatility number into a trading picture. That is why traders watch bands and statisticians quote the deviation.

Use the bands when you want the picture: where the price is inside its recent range and whether that range is widening or narrowing. Use the standard deviation on its own when you want the number: for a calculation, a comparison across many stocks, or a risk model. They agree by construction, because the bands are built from the deviation.

Common mistakes with Bollinger Bands

The most common mistake is treating a touch of the upper band as a sell signal and a touch of the lower band as a buy signal. In a strong trend the price can walk along a band for days or weeks, and selling into that strength loses money. Bands mark extremes of the recent range, not turning points. The second mistake is using too few prices. With exactly 20 prices the bands are built on a single window with no history behind it, and one unusual close can move them a lot. Use 30 or 40 prices so the window you care about sits at the end of a longer series, even though only the last 20 are used.

The third mistake is changing the period to fit the past. A 10-day band will always hug the price more closely than a 20-day band, and a 50-day band will always look smoother. Picking the setting that would have worked best last month is curve-fitting, not analysis. Use the standard 20 and 2 unless you have a reason stated in advance.

The fourth mistake is reading the bands without the bandwidth. Two charts can show the same price touching the same band, one with a 4% bandwidth and one with a 20% bandwidth, and they mean very different things. Always check how wide the channel is before judging where the price sits inside it. Check every input once before you trust the answer: a single mistyped zero changes the result far more than any rounding in the calculator ever will.

How to use this Bollinger Bands calculator

Using it takes less than a minute. Paste your closing prices, oldest first, then check the period and the number of standard deviations. Then read the results box: the main figure is highlighted at the top, and the supporting figures sit below it so you can see how the answer was reached. Change any input and the figures update at once, which makes it easy to test a few versions of the same decision side by side.

Bands describe the path of a price, and the return is what that path earned. The stock return calculator works out the gain or loss on a holding over the period you choose, which is the fact behind any band picture. If you hold more than one stock, the portfolio return calculator shows what the whole set did together, which is the number that matters for your money.

Everything runs in your browser. Nothing you type is uploaded, stored or shared, and there is no account to create. That matters for a tool that deals with money: your salary, your holdings and your plans stay on your own device. Bookmark the page and come back whenever the numbers change, and the calculator will be ready with the same defaults you saw today.

Frequently Asked Questions

A squeeze is when the bands narrow to an unusually small width, which means the price has been moving in a tight range and volatility is low. Squeezes often come before a large move, but the squeeze itself does not say whether the move will be up or down. Traders watch the bandwidth figure on this page to spot a squeeze, then wait for the price to break out before acting.

The bands are set two standard deviations from the average, which covers about 95% of closes if prices moved in a neat bell curve. Real prices do not: they have sharper moves and fatter tails than the textbook curve, so breaks outside the bands are normal. A break is information about volatility, not an automatic signal to trade against it.

Yes. It is free, with no sign-up and no download. Open the page, type in your numbers and read the result. It works on a phone, a tablet or a computer, and you can use it as many times as you like.

The maths is exact for the numbers you type in, but the answer is only as good as those inputs. Bollinger Bands are a technical indicator, not a forecast and not investment advice. They describe how far the price has moved from its recent average; they do not say where it will go next, and no band touch should be the sole reason for a trade. Treat the result as a planning figure and check the final numbers with the actual policy document, contract or adviser before you commit money.

More free tools

More calculators and utilities from Sortrun — free, no sign-up.