Harmonic Pattern Calculator

Check the Fibonacci ratios of an XABCD pattern.

Your numbers

The pattern
Swing prices (example prices)

Bullish: X low, A high, B low, C high, D low. Bearish is the mirror image.

$
$
$
$
$

Leave at 0 to see where D would complete each pattern.

Results update as you type. Nothing you enter leaves your browser.

Your results

Ratios fit

Gartley

D sits at 0.785 of XA and 1.429 times BC.

B retracement of XA
0.620
C retracement of AB
0.621
D retracement of XA
0.785
CD as a multiple of BC
1.429

Harmonic patterns are a set of Fibonacci ratio conventions. A pattern that fits every ratio can still fail, and different books use slightly different ratios. This tool checks math; it doesn't predict prices.

See the full breakdown

Estimates based on your inputs and the assumptions listed below. Not tax, financial or lending advice. Disclaimer

Your full breakdown

Sketch with the Gartley zone

X to A is the first leg. B, C and D are judged as ratios of the legs before them.

Your swingsExpected CD legCompletion zone
Gartley D zone X $40.00A $60.00B $47.60C $55.30D $44.30
The zigzag uses your prices. The shaded band is where D would complete a Gartley by the usual ratios. Price often ignores these zones.

Ratio check for each pattern

D counts as a fit within 0.03 of the pattern's XA ratio. The zone runs from that XA level to the nearest end of the CD range.

PatternB (of XA)C (of AB)D (of XA)CD (of BC)D completion zone
Gartley0.618: Fits0.382 to 0.886: Fits0.786: Fits1.13 to 1.618: Fits$44.28
Bat0.382 to 0.50: Doesn't fit0.382 to 0.886: Fits0.886: Doesn't fit1.618 to 2.618: Doesn't fit$42.28
Butterfly0.786: Doesn't fit0.382 to 0.886: Fits1.27: Doesn't fit1.618 to 2.24: Doesn't fit$34.60 to $38.05
Crab0.382 to 0.618: Doesn't fit0.382 to 0.886: Fits1.618: Doesn't fit2.24 to 3.618: Doesn't fit$27.64

The math

XA = $20.00. AB = $12.40, so B = $12.40 / $20.00 = 0.620 of XA. BC = $7.70, so C = $7.70 / $12.40 = 0.621 of AB.

AD = $15.70, so D = 0.785 of XA. CD = $11.00, so CD = 1.429 times BC.

Common reference levels after D: 0.382 of AD = $50.30, 0.618 of AD = $54.00. Many traders watch these as first and second targets.

Where the Gartley is usually treated as failed: Beyond X. A Gartley's D should not pass the start of the pattern.

Things to know

  • Harmonic patterns were popularized in trading books, and the exact ratios differ between authors. The ones here are the commonly cited sets.
  • Real swings rarely hit a ratio exactly, so traders allow a tolerance. A wider tolerance finds more patterns and more false ones.
  • The completion zone is where some traders start watching for a reversal, not a level price must turn at.
  • Picking X, A, B and C is a judgment call. Two people can label the same chart differently and get different zones.
  • Decide where you'd be wrong before anything else, and keep any position small enough that being wrong is affordable.
  • This is an educational calculator. It doesn't use market data or tell you to buy or sell anything.

Short answer

A harmonic pattern is five swing points, X, A, B, C and D, whose legs match set Fibonacci ratios. In a Gartley, B retraces about 0.618 of XA and D completes near 0.786 of XA. Enter your swings to see which pattern's ratios fit and where D would complete. These are conventions and often fail.

Example

With B at 0.620 of XA, C at 0.621 of AB and D at 0.785 of XA, the swings fit a Gartley.

How it's calculated

B ratio = AB / XA. C ratio = BC / AB. D ratio = AD / XA. CD ratio = CD / BC. Commonly cited ratios: Gartley B 0.618, D 0.786, CD 1.13 to 1.618. Bat B 0.382 to 0.50, D 0.886, CD 1.618 to 2.618. Butterfly B 0.786, D 1.27, CD 1.618 to 2.24. Crab B 0.382 to 0.618, D 1.618, CD 2.24 to 3.618. C is 0.382 to 0.886 of AB for all four. D zone = from A - D ratio x XA (bullish) to the nearest end of the CD range.

Assumptions

  • Ratios are the commonly cited sets. Authors differ a little, so a pattern can fit one book and not another.
  • B must be within about 0.03 of its listed ratio, and D within 0.03 of its XA level.
  • You choose the swing points. The tool doesn't find them on a chart or use market data.

Frequently asked questions

What are the Gartley pattern ratios?

In the commonly cited version, B retraces 0.618 of XA, C retraces 0.382 to 0.886 of AB, CD is 1.13 to 1.618 times BC, and D completes at 0.786 of XA.

What's the difference between a Gartley and a Bat?

Both complete inside the XA leg. A Bat has a shallower B (0.382 to 0.50 of XA) and a deeper D at 0.886 of XA. A Gartley has B near 0.618 and D at 0.786.

How are Butterfly and Crab patterns different?

In both, D goes past X. A Butterfly completes around 1.27 of XA with B near 0.786. A Crab completes at 1.618 of XA, the deepest of the four, with B between 0.382 and 0.618.

What is the D completion zone?

It's where two measurements agree: the XA ratio for D and the range of the CD leg measured from BC. Some traders watch this zone for a reversal. It is not a level price has to turn at.

Do harmonic patterns work?

There's no guarantee. They are trading conventions built on Fibonacci ratios, choosing the swing points is subjective, and many patterns fail. Treat them as one way to describe a chart, not a forecast.

Sources

  1. Types of Orders Investor.gov (SEC)
  2. Day Trading FINRA
  3. How Stock Markets Work Investor.gov (SEC)

Formulas and figures last checked Nov 5, 2026.

Go deeper

Related guides and calculators