NewAI Part GeneratorFree to get started
FREE TOOL

Crystal load capacitance calculator

Two numbers go into this crystal load capacitance calculator: the CL on the datasheet and your stray capacitance. Out come the two load capacitors, the nearest standard values and the CL they actually give. Add the crystal's C0 and motional capacitance to see the frequency error in ppm.

Solve for
Examples
pF

From the crystal datasheet.

pF

PCB traces and oscillator pins. AN2867 uses 5 pF in its example.

pF

Optional: if the MCU datasheet lists it. Adds to each leg, so Cs is then only the PCB part.

Capacitor series
%

Optional: shows how far CL moves.

pF

Optional: from the datasheet.

fF

Optional: listed as C1 in crystal datasheets. 1 fF = 0.001 pF.

Hz

Optional: turns the ppm error into hertz.

C1 = C2, nearest E12

15 pF

exact 14 pF

Exact C1 = C2
14 pF
CL with these capacitors
12.5 pF
CL error
+0.5 pF
CL shift from ±5 % capacitors
±0.375 pF of 7.5 pF from the capacitors

Enter C0 and the motional capacitance from the crystal datasheet to see the frequency error in ppm.

The stray figure is an estimate. Confirm the final values by measuring the frequency on the assembled board, and check the oscillator gain margin (AN2867 asks for more than 5).

Standard E12 pairs closest to CL = 12 pF

C1C2CLCL error
12 pF18 pF12.2 pF+0.2 pF
12 pF15 pF11.67 pF-0.333 pF
15 pF15 pF12.5 pF+0.5 pF
12 pF12 pF11 pF-1 pF
10 pF15 pF11 pF-1 pF
15 pF18 pF13.18 pF+1.18 pF

How to calculate crystal load capacitance and pick C1 and C2

Use C1 = C2 = 2 × (CL − Cs). A crystal with CL = 15 pF and 5 pF of stray capacitance needs 20 pF on each side. The crystal sees the two capacitors in series, so together they contribute 10 pF, and the 5 pF of stray brings the total to 15 pF.

Crystal load capacitance formula

In a Pierce oscillator the crystal sits between two capacitors to ground, so the crystal oscillator load capacitance is those two in series, plus whatever stray capacitance the board and pins add.

CL = (C1 × C2) ÷ (C1 + C2) + Cs
CL
load capacitance from the crystal datasheet, in pF
C1, C2
the external load capacitors, in pF
Cs
stray capacitance of the PCB and connections, in pF

With equal capacitors this solves directly. For a chosen C1, the second capacitor follows:

C1 = C2 = 2 × (CL − Cs)     C2 = S × C1 ÷ (C1 − S), with S = CL − Cs

If the MCU datasheet lists the capacitance of each oscillator pin, that capacitance belongs in each leg, and Cs is then only the PCB part:

C1 = C2 = 2 × (CL − Cs) − Cpin
Cpin
capacitance of each oscillator pin (use the average if they differ by under 4 pF)

The load sets the frequency through the crystal's motional capacitance Cm and shunt capacitance C0:

f = Fs × (1 + Cm ÷ (2 × (C0 + CL)))     TS = −Cm × 10⁶ ÷ (2 × (C0 + CL)²) ppm/pF

Crystal load capacitor examples

Example 1: the AN2867 case, CL = 15 pF with 5 pF stray

CL − Cs = 10 pF, so C1 = C2 = 20 pF. That is an E24 value. Restricted to E12, the nearest part is 22 pF, which gives CL = 16 pF: 1 pF high, so the crystal runs a little slow.

Example 2: a 32.768 kHz Epson FC-135 with CL = 12.5 pF

With 5 pF of stray, C1 = C2 = 15 pF. At typical C0 = 1.0 pF and motional capacitance 3.4 fF the trim sensitivity is −9.33 ppm/pF. A ±5 % capacitor moves CL by ±0.375 pF, which is ±3.5 ppm, or ±0.3 s per day for a real-time clock.

Example 3: a wrong stray estimate on the AN2867 8 MHz crystal

Designing for CL = 10 pF with Cs = 5 pF gives C1 = C2 = 10 pF. If the real stray is only 3 pF, the crystal sees 8 pF. With Cm = 0.027 pF and C0 = 5.57 pF the frequency error is +128 ppm, about 1020 Hz.

Example 4: the Microchip case, with pin capacitance

CL = 12 pF, PCB 2.5 pF and an average pin capacitance of 5.5 pF. C1 = C2 = 2 × (12 − 2.5) − 5.5 = 13.5 pF, which Microchip rounds down to 13 pF.

Crystal oscillator capacitor selection: C1 and C2 by CL and stray

Exact C1 = C2 in pF. Round to the nearest standard value and use the crystal oscillator capacitor calculator above to see the CL you end up with.

CL \ Cs2 pF3 pF4 pF5 pF6 pF7 pF
6 pF8642n/an/a
7 pF108642n/a
8 pF12108642
9 pF141210864
10 pF1614121086
12 pF201816141210
12.5 pF211917151311
15 pF262422201816
18 pF323028262422
20 pF363432302826

Trim sensitivity by crystal and load

Parts per million of frequency change for each pF of CL error. Typical parameters of two published crystals; a smaller CL is more sensitive.

Crystal6 pF8 pF10 pF12.5 pF15 pF18 pF20 pF
ST AN2867 8 MHz example−101−73.3−55.7−41.3−31.9−24.3−20.6
Epson FC-135 32.768 kHz−34.7−21−14−9.33−6.64−4.71−3.85

Getting the last few ppm

Treat the calculated value as a starting point. The stray figure is an estimate, so build a board, measure the frequency without loading the oscillator (use a buffered clock output or a very low-capacitance probe) and adjust the capacitors. Too much load slows the crystal and also makes it harder to start: AN2867 asks for an oscillator gain margin above 5, and the critical gain rises with C0 and CL. Use C0G/NP0 capacitors, keep traces short and symmetrical with a ground guard, and keep switching signals away from the oscillator pins. This model only covers the load: the initial tolerance, temperature curve and aging of the crystal add on top. The ppm budget in AN2867 adds the crystal's datasheet accuracy to the pulling error, and notes that temperature variation is not included.

Glossary

Load capacitance (CL)
The capacitance the crystal was trimmed to see. The circuit must present this value for the crystal to run at its marked frequency.
Xtal
Common shorthand for crystal, so an xtal capacitor is one of the two load capacitors, C1 or C2.
Stray capacitance (Cs)
Capacitance from traces and oscillator pins that adds to the external capacitors.
Motional capacitance (Cm or C1)
The element of the crystal equivalent circuit that sets how far the frequency can be pulled. From a few fF to a few tens of fF.
Shunt capacitance (C0)
The real capacitance between the crystal electrodes and holder, usually 1 to 7 pF.
Trim sensitivity
How many ppm the frequency moves for each pF change in load capacitance at a given CL.
Pierce oscillator
The inverter, crystal and two capacitors to ground used inside almost every microcontroller.

Related guides

Frequently asked questions

What is crystal load capacitance?

The capacitance the crystal was trimmed to see, listed as CL on its datasheet. The circuit must present this value, C1 and C2 in series plus the stray capacitance, for the crystal to run at its marked frequency.

How do you calculate crystal load capacitors?

With equal capacitors, C1 = C2 = 2 × (CL − Cs), where CL comes from the crystal datasheet and Cs is the stray capacitance. A 15 pF crystal with 5 pF of stray needs 20 pF on each side.

Why is it 2 × (CL − Cs) and not just CL?

The crystal sees the two capacitors in series through ground, so together they contribute half of one capacitor. Stray capacitance adds on top of that.

What value should I use for stray capacitance?

ST uses 5 pF in its AN2867 example. Microchip estimates about 2.5 pF for the traces of a tight layout, and its worked example adds 4.5 and 6.5 pF for the two oscillator pins. If your MCU datasheet lists pin capacitance, enter it separately, because it adds to each leg rather than directly to CL.

Can I use 22 pF capacitors with an 18 pF crystal?

Not with 5 pF of stray: 22 pF on each side gives CL = 16 pF, below the 18 pF the crystal was trimmed for, so it runs fast. The match is 26 pF on each side, or 27 pF as the nearest standard value.

Do C1 and C2 have to be equal?

No, only the series combination sets CL, so unequal values work and can get closer to a target with standard parts. Most application notes assume equal values, so keep them close and recheck the gain margin.

What happens if the load capacitance is wrong?

The crystal runs off frequency: too little load runs fast, too much runs slow. The trim sensitivity is in the crystal's C0 and motional capacitance; the 8 MHz crystal in AN2867 moves 55.7 ppm per pF at a 10 pF load. Far too much load can also stop the oscillator from starting.

What capacitor type should I use?

C0G/NP0 ceramic. Its value does not move with temperature or voltage the way X7R does, and any change in the capacitors becomes a change in frequency.

More free PCB tools

See all free electronics tools →

Sources

Design the whole board, not one number

ProtoFlow is free AI PCB design software: describe a circuit and get a schematic with real parts, PCB layout with an autorouter, SPICE simulation and Gerber files. Native KiCad, Altium and EAGLE import and export. Free on macOS, Windows and Linux.

Get for Mac

Free to start. No card required.