Bollinger Bands Calculator

Upper, middle and lower Bollinger Bands, %B and bandwidth for every bar from your prices, with a chart.

Runs in your browser. Files never leave your device.
One closing price per line, or a CSV export with a Close column. Oldest first; exports listed newest first are put in date order.
Showing example EUR/USD-style daily data.

150 bars · 2026-01-05 to 2026-07-31

20 bars and 2 standard deviations are the standard.

Bands on the last bar1.16501 – 1.20426Middle 1.18464 · %B 0.05 · bandwidth 3.31%. The close is 5% of the way from the lower band to the upper band.
Bollinger Bands(20, 2)

Last 131 bars

  • Close
  • Middle
  • Upper band
  • Lower band
Last 20 bars, newest first
DateCloseLowerMiddleUpper%BBandwidth %
2026-07-311.16701.165011.184641.204260.053.31
2026-07-301.17181.167731.185991.204240.113.08
2026-07-291.17131.169681.187191.204690.052.95
2026-07-281.17341.171791.188661.205530.052.84
2026-07-271.17991.174211.189741.205270.182.61
2026-07-241.18281.175251.190771.206290.242.61
2026-07-231.17871.176181.191501.206820.082.57
2026-07-221.17971.178071.192501.206920.062.42
2026-07-211.17631.179871.193621.20737-0.132.30
2026-07-201.17961.183081.194991.20690-0.151.99
2026-07-171.18451.186271.195921.20556-0.091.61
2026-07-161.18471.188251.196411.20457-0.221.36
2026-07-151.19111.189311.196581.203850.121.21
2026-07-141.19431.187871.196301.204730.381.41
2026-07-131.19661.184641.195601.206550.551.83
2026-07-101.19681.182771.194941.207100.582.04
2026-07-091.19691.181041.194241.207440.602.21
2026-07-081.19341.179561.193551.207540.492.34
2026-07-071.19911.177491.192841.208180.702.57
2026-07-061.19481.176141.191951.207770.592.65

Indicators describe past prices; they don't predict what happens next. A calculator for planning trades, not financial advice. Check your broker's contract size, pip definition and fees.

About the Bollinger Bands Calculator

Calculate Bollinger Bands from your own prices: the middle band, the upper and lower bands, %B and bandwidth for every bar. Paste closing prices or load a CSV export, keep the standard 20 bars and 2 standard deviations or change them, and see the latest bands with a chart.

The page also says where the last close sits within the bands, and whether it has moved outside them, so you can read the result without studying the chart.

How it works

The middle band is the simple moving average of the last 20 closes. The upper and lower bands are that average plus and minus two standard deviations of the same 20 closes, so the bands widen when prices swing more and narrow when they calm down.

The standard deviation is the population form, dividing by 20 rather than 19, which is how John Bollinger defined the bands and how most platforms compute them. Using the other form would make the bands about 2.6% wider.

%B shows where the close is: 0 on the lower band, 1 on the upper band, 0.5 on the middle, and below 0 or above 1 outside the bands. Bandwidth is the distance between the bands as a percentage of the middle band; a very low bandwidth is often called a squeeze.

Assumptions and limits

  • Prices must be in date order, oldest first; dated files listed newest first are reordered automatically.
  • The first bands appear on the 20th bar, or the nth for another period.
  • A close outside a band isn't a signal on its own; in strong trends prices can ride along a band.

Worked examples

Three closes

With closes 1, 2 and 3 over 3 bars, the middle band is 2 and the standard deviation 0.816, so the bands are 0.37 and 3.63 at 2 standard deviations.

A squeeze

When the last 20 closes are all the same, the standard deviation is 0 and the three bands meet: bandwidth 0%.

Reading %B

A %B of 0.80 means the close is 80% of the way from the lower band to the upper band.

How to use the Bollinger Bands Calculator

  1. Add at least 20 closes. Pasted from a spreadsheet or loaded from a CSV export.
  2. Set period and width. 20 bars and 2 standard deviations is the standard.
  3. Read the bands. With %B, bandwidth and every bar to download.

Frequently asked questions

How are Bollinger Bands calculated?

Take the 20-period simple moving average of the closing price as the middle band. Work out the standard deviation of the same 20 closes, then add twice it to the middle band for the upper band and subtract twice it for the lower band.

What does %B mean?

%B is the position of the close between the bands: 1 means it is on the upper band, 0 on the lower band, and 0.5 on the middle band. Values above 1 or below 0 mean the close is outside the bands.

What is a Bollinger Band squeeze?

A squeeze is when the bands come unusually close together, shown by a low bandwidth. It means price swings have become small, and such quiet spells are often followed by a larger move, although not in a direction the bands can tell.

Why are my bands slightly different from my platform's?

Check that both use 20 bars, 2 standard deviations, the closing price and the population standard deviation. A few tools use the sample standard deviation, which makes the bands slightly wider.

Can I use other settings?

Yes. Some traders use 10 bars with 1.5 standard deviations for short-term charts, or 50 bars with 2.5 for long-term ones. Choose any whole number of bars and a width up to 10 standard deviations.

This tool runs entirely in your browser. What you enter or upload stays on your device and is never sent to our servers.