Crystal Load Capacitor Calculator

Crystal Load Capacitor Calculator

The two capacitors a Pierce oscillator needs, from the crystal’s specified load capacitance and the stray capacitance of your board and the chip’s own pins — plus the part nobody prints: how far off frequency the nearest standard value puts you, and whether the oscillator has enough gain to start at all.

Crystal load capacitors

CL and stray → C1, C2
From the crystal’s datasheet. It is not a property of the quartz — it is the load the manufacturer calibrated the frequency against, and running the crystal at any other load puts it off frequency. Use the figures from your part’s datasheet; typical values vary widely between manufacturers.
The chip’s own input and output capacitance on OSC_IN and OSC_OUT, typically 2–5 pF. Use the figures from your part’s datasheet; typical values vary widely between manufacturers.
The tracks, the pads and the solder resist. Roughly 0.5–1 pF per centimetre of short track over a ground plane; keep the loop tight and this stays small and predictable.
The static capacitance between the crystal’s electrodes, 2–7 pF for a small AT-cut part. Needed for the frequency pulling and the gain margin.
Femtofarads — a few tens at most. It is what makes a crystal pullable at all; C0/C1 is typically 250 to 300.
The datasheet maximum, not the typical. It rises steeply on small packages and on 32.768 kHz tuning forks, where 50–90 kΩ is normal. Use the figures from your part’s datasheet; typical values vary widely between manufacturers.
From the microcontroller’s datasheet or its oscillator application note. Milliamps per volt — a high-speed oscillator has tens, a low-speed one microamps per volt.
The most power the crystal may dissipate, from its datasheet. Exceeding it ages the quartz and can fracture it. Use the figures from your part’s datasheet; typical values vary widely between manufacturers.
Used only to draw the band on the chart, so you can see whether the capacitor you fit puts you inside the tolerance you paid for.
A Pierce oscillator: the chip's internal inverting amplifier, the feedback resistor that biases it into its linear region, the crystal between the two oscillator pins and the two load capacitors to ground. The crystal is drawn as its symbol — two plates with the quartz blank between them. The stray capacitance counted below is not a component you fit: it is the pins and the tracks, and it counts. No current dots are drawn; the loop current here is a few milliamps of radio-frequency, not a DC path.
14pFExample

a 8 MHz crystal specified for 12 pF, with 3 pF of pin capacitance and 2 pF of board stray, C0 5 pF, motional C1 15 fF, ESR 80 Ω, oscillator gm 25 mA/V

Advertisement

Load capacitors, frequency pulling and gain margin

CL = (C1·C2)/(C1+C2) + Cstray → C1 = C2 = 2·(CL − Cstray)  |  Δf/f = C1m/2 · (1/(C0+CL,actual) − 1/(C0+CL,spec))  |  S = C1m ÷ (2·(C0+CL)²) ppm/pF  |  gm,crit = 4·ESR·(2πF)²·(C0+CL)²  |  Irms,max = √(DLmax ÷ ESR)
C1m
the crystal’s MOTIONAL capacitance, in the same units as C0 and CL. A few femtofarads; it is what makes a crystal pullable at all
C0
the static capacitance between the electrodes, 2–7 pF
Cstray
the oscillator’s pin capacitance plus the board’s. It adds to the load whether you account for it or not
S
trim sensitivity — how many parts per million the frequency moves for each extra picofarad of load
gm,crit
the transconductance at which the amplifier’s negative resistance just cancels the crystal’s losses. ST asks for five times this

Worked example

a 8 MHz crystal specified for 12 pF, with 3 pF of pin capacitance and 2 pF of board stray, C0 5 pF, motional C1 15 fF, ESR 80 Ω, oscillator gm 25 mA/V
Stray = 3 + 2 = 5 pF, so the series pair must be 12 − 5 = 7 pF
Two equal capacitors in series are half of one, so C1 = C2 = 2 × 7 = 14 pF → 15 pF (E12, nearest)
With 15 pF fitted the crystal sees 7.5 + 5 = 12.5 pF, 0.5 pF more than it was calibrated for
Δf/f = 0.015 ÷ 2 × (1/(5+12.5) − 1/(5+12)) = -12.61 ppm — 100.8 Hz low, or 1.089 seconds a day
Trim sensitivity at the specified load is 25.95 ppm/pF, and the whole pull from series resonance to 12 pF is only 441.2 ppm
gm,crit = 4 × 80 × (2π × 8 MHz)² × (17 pF)² = 233.7 µS, so the gain margin is 25 mA/V ÷ that = 107.0× — well above the 5 that AN2867 asks for
The drive limit allows 1.118 mA RMS through the crystal

What the nearest standard capacitor costs you

C1 = C2 fittedLoad the crystal seesFrequency errorSeconds per day
10 pF10.0 pF58.82 ppm5.08
12 pF11.0 pF27.57 ppm2.38
14 pF12.0 pF0.00 ppm0.00
15 pF12.5 pF-12.61 ppm1.09
18 pF14.0 pF-46.44 ppm4.01
22 pF16.0 pF-84.03 ppm7.26
27 pF18.5 pF-122.03 ppm10.54
33 pF21.5 pF-158.16 ppm13.66
Computed from this page’s own formula at the default crystal. The 14 pF row is the exact answer; every other row is what a substitution costs. Notice how flat it is — the trim sensitivity falls as the square of the total load, so a crystal already sitting at 12 pF is hard to pull far. That is good news for tolerance and bad news for trimming.

Loading a crystal correctly

A quartz crystal is not a frequency. It is a very high-Q resonator whose exact frequency depends on what it is connected to, and the manufacturer calibrates it against a specified load capacitance — 12 pF, 18 pF, 20 pF are common. Present a different load and it runs at a different frequency. In a Pierce oscillator, the commonest arrangement by far, the load is the two capacitors from the oscillator pins to ground, in series as far as the crystal is concerned, plus whatever stray capacitance the pins and the tracks add: CL = C1·C2/(C1+C2) + Cstray. Two equal capacitors in series make half of one, so each has to be twice the remainder.

The stray is not a rounding error. A microcontroller’s OSC_IN and OSC_OUT pins carry a few picofarads each, and a centimetre of track over a ground plane adds roughly half a picofarad more. On a 12 pF crystal, 5 pF of stray takes the external capacitors from 24 pF down to 14 pF — nearly half. Leaving it out is the commonest reason a board runs fast: the real load is higher than intended, and — this is the direction that catches people — a crystal with too much load capacitance runs slow, not fast. Leaving the stray out of the calculation makes the fitted capacitors too big, which makes the total load too big, which makes the clock slow. The arithmetic is worth doing twice.

Why too much load means slow. Between its series and parallel resonances a crystal looks inductive, and the load capacitance resonates against it. The Butterworth–Van Dyke model — a motional branch Lm, C1m, Rm in series with the static capacitance C0 across it — gives the load resonance exactly as fL = fs·√(1 + C1m/(C0+CL)), which to well under a part per million is fs(1 + C1m/(2(C0+CL))). Increase CL and that correction shrinks, so the frequency falls back towards the series resonance. The whole range available is C1m/(2(C0+CL)) — only 441.2 ppm on this crystal — which is why a crystal is stable and also why it cannot be pulled far. Differentiating gives the trim sensitivity, C1m/(2(C0+CL)²): 25.95 ppm per picofarad here, falling as the square of the load. Every one of those relations was checked on this page by root-finding the actual reactance of the equivalent circuit rather than by trusting the series expansion.

Will it start? Getting the frequency right is no use if the oscillator never runs. The amplifier presents a negative resistance to the crystal — a nodal solve of the inverter with C1 and C2 gives |Rneg| = gm/(ω²·C1·C2), which is derived and checked here — and oscillation starts only while that exceeds the crystal’s losses. Because C0 shunts the motional branch, the loss the amplifier actually has to overcome is ESR × (1 + C0/CL)², and putting the two together gives ST’s criterion gm,crit = 4·ESR·(2πF)²·(C0+CL)², with a gain margin of at least 5 asked for on a high-speed oscillator and 3 on a 32.768 kHz one. That margin is where low-power designs fail: a tuning-fork crystal has an ESR of 50–90 kΩ against 80 Ω here, and a watch oscillator has microamps per volt of transconductance rather than milliamps. Bigger load capacitors always make starting harder, because gm,crit goes as the square of the load.

Drive level, and the rest of the layout. Too much current through a crystal ages the quartz, shifts the frequency and eventually cracks the blank; the datasheet gives a maximum drive level in microwatts and DL = ESR × I², so the RMS current limit is √(DL/ESR) — 1.118 mA here. A series resistor at OSC_OUT is the usual way to reduce it, at the cost of gain margin. Keep the whole loop short, put a ground pour under it and nothing else near it, and bring the crystal’s ground and both capacitors’ grounds to one point. For the digital side of the clock see the PWM duty cycle calculator; for an RC-timed oscillator instead of a crystal, the 555 astable calculator; and for the LC resonance this is the quartz analogue of, the LC resonant frequency calculator. Use the figures from your part’s datasheet; typical values vary widely between manufacturers.

Advertisement

Frequently asked questions

How do I calculate crystal load capacitors?

C1 = C2 = 2 × (CL − Cstray), where CL is the crystal’s specified load capacitance and Cstray is the oscillator pin capacitance plus the board’s. For a 12 pF crystal with 5 pF of stray that is 14 pF each, so 15 pF from the E12 series.

What happens if the crystal load capacitance is wrong?

The frequency shifts. Too much load makes it run slow, too little makes it run fast, by Δf/f = C1m/2 × (1/(C0+CL,actual) − 1/(C0+CL,spec)). Fitting 15 pF where 14 pF was needed costs 12.61 ppm here — about a second a day.

Why does a crystal run slow with too much load capacitance?

Because the oscillator runs between the crystal’s series and parallel resonances, where it looks inductive, and the load capacitance pulls it above the series resonance by C1m/(2(C0+CL)). More load capacitance means less pull, so the frequency falls back towards the series resonance.

How much can you pull a crystal’s frequency?

Not far. The total available range is C1m/(2(C0+CL)) — 441.2 ppm on a typical 8 MHz part — and the sensitivity falls as the square of the load, so the useful trimming range at a normal 12–20 pF load is tens of parts per million at most.

What is the gain margin of a crystal oscillator?

The oscillator’s transconductance divided by the critical transconductance gm,crit = 4 × ESR × (2πF)² × (C0 + CL)². ST’s AN2867 asks for at least 5 on a high-speed oscillator and 3 on a 32.768 kHz one. Below that the oscillator may start slowly, start only at some temperatures, or not at all.

What is drive level and why does it matter?

The power the crystal dissipates, ESR × I². Exceeding the datasheet maximum ages the quartz, drifts the frequency and can fracture the blank. At 80 Ω and a 100 µW limit the current must stay below 1.118 mA RMS; a series resistor at OSC_OUT is the usual remedy.

Related calculators

References

  1. STMicroelectronics. AN2867: Guidelines for oscillator design on STM8AF/AL/S and STM32 MCUs/MPUs, Rev. 24, February 2026. CL = (CL1·CL2)/(CL1+CL2) + Cs; gm,crit = 4 · ESR · (2πF)² · (C0+CL)² with a gain margin above 5 for HSE and above 3 for LSE; drive level DL = ESR · IQ² and IQmax,pp = 2√(2·DLmax/ESR).
  2. Renesas. AN-831: Crystal Load Curve, Rev. B. The load resonance FL² = FR²·(1 + C1/(C0+CL)), and the trim sensitivity dF/dCL = −C1/(2(C0+CLn)²) in parts per million per picofarad.
  3. Vittoz EA, Degrauwe MGR, Bitz S. High-performance crystal oscillator circuits: theory and application. IEEE Journal of Solid-State Circuits, vol. 23 no. 3, June 1988, pp. 774–783. doi:10.1109/4.318. The negative resistance of the three-point oscillator and the critical transconductance for start-up.
  4. IEC 60063:2015. Preferred number series for resistors and capacitors (E12 and E24), used for the standard capacitor values suggested here.