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
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
Load capacitors, frequency pulling and gain margin
- 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 fitted | Load the crystal sees | Frequency error | Seconds per day |
|---|---|---|---|
| 10 pF | 10.0 pF | 58.82 ppm | 5.08 |
| 12 pF | 11.0 pF | 27.57 ppm | 2.38 |
| 14 pF | 12.0 pF | 0.00 ppm | 0.00 |
| 15 pF | 12.5 pF | -12.61 ppm | 1.09 |
| 18 pF | 14.0 pF | -46.44 ppm | 4.01 |
| 22 pF | 16.0 pF | -84.03 ppm | 7.26 |
| 27 pF | 18.5 pF | -122.03 ppm | 10.54 |
| 33 pF | 21.5 pF | -158.16 ppm | 13.66 |
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.
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
- 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).
- 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.
- 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.
- IEC 60063:2015. Preferred number series for resistors and capacitors (E12 and E24), used for the standard capacitor values suggested here.
