Table of Contents
ToggleA quartz crystal only hits its printed frequency when the circuit around it shows the exact load it was calibrated for. Here we size the two capacitors, estimate stray capacitance and check what a wrong value costs in ppm.
Every crystal datasheet gives a load capacitance, and the two small capacitors on the board must recreate it. Below you get the formula, a 12 pF worked example, a calculator and field checks for a clock that runs fast, slow or not at all.

How do you calculate crystal load capacitance for a Pierce oscillator?
Crystal load capacitance is the total capacitance the crystal sees across its two pins: CL = (C1 × C2) ÷ (C1 + C2) + Cstray. With equal capacitors this gives C1 = C2 = 2 × (CL minus Cstray). For a 12 pF crystal on a board with about 4 pF of stray capacitance, each capacitor is 2 × (12 minus 4) = 16 pF, so two 16 pF C0G parts are fitted.
- Read CL from the crystal datasheet, for example 12 pF.
- Estimate stray capacitance from pins and traces, usually 3 to 5 pF.
- Work out C1 = C2 = 2 × (CL minus Cstray).
- Fit the nearest C0G value and measure the frequency on a buffered output.
What Is Crystal Load Capacitance?
Crystal load capacitance (CL) is the capacitance the oscillator circuit must present across the crystal pins so that it runs at the frequency stamped on it. The maker trims every crystal while it sits in a test fixture with exactly this load, so your circuit has to copy that fixture.
- Pierce formula: CL = (C1 × C2) ÷ (C1 + C2) + Cstray.
- Equal capacitors: C1 = C2 = 2 × (CL minus Cstray).
- Typical stray capacitance on a small board: 3 to 5 pF.
- Too much load makes the clock slow, too little makes it fast.
If you are new to quartz, first read how a crystal oscillator works, because the load capacitors are part of the resonant loop. The crystal behaves like a very sharp series LC resonant circuit, and any capacitance hanging on its pins moves that resonance a little.
How Does the Pierce Oscillator Load the Crystal?
In a Pierce oscillator the two load capacitors sit from each crystal pin to ground, so the crystal sees them in series plus whatever stray capacitance the pins and copper add. Almost every microcontroller clock input uses this circuit with an inverting amplifier inside the chip.
The inverter gives 180 degrees of phase shift and the crystal with C1 and C2 gives the other 180 degrees. A large feedback resistor Rf biases the inverter in its linear region, and an optional series resistor Rs on XOUT limits the drive power into the crystal.

C1 and C2 are in series as seen from the crystal, which is why each one is about twice the load figure. If you need a refresher, see how capacitors combine in series and parallel; two equal capacitors in series give half of one value.
The crystal does not run at its pure series resonance in a Pierce circuit. It runs slightly above it, in the narrow region where it looks inductive, and the load capacitance decides exactly where in that region the frequency settles.
Crystal Load Capacitance Formula and How to Calculate C1 and C2
The crystal load capacitance formula adds the series value of C1 and C2 to the stray capacitance, and you solve it backwards for the capacitor value. With equal capacitors the answer is simply twice the load minus twice the stray.
If C1 = C2 = C:
CL = C ÷ 2 + Cstray
C1 = C2 = 2 × (CL minus Cstray)
The capacitor values come out small, usually between 10 and 33 pF for MHz crystals and between 6 and 22 pF for 32.768 kHz watch crystals. If your sum gives a value close to zero or negative, the stray capacitance already meets or exceeds the load and you should pick a crystal with a higher CL.
Some microcontrollers have programmable internal load capacitors on the oscillator pins. Count that internal value as part of C1 and C2, or switch it off, before you add external parts.
How Much Stray Capacitance Should You Assume?
Assume 3 to 5 pF of stray capacitance for a compact layout with the crystal placed within a centimetre of the chip. Long traces, sockets and thick boards push it higher.
| Source of stray capacitance | Typical value | How to reduce it |
|---|---|---|
| Oscillator pin capacitance of the IC | 1 to 5 pF | Read the pin value in the chip datasheet |
| PCB trace to ground plane | About 0.5 to 1 pF per inch | Keep XIN and XOUT traces short |
| Total for a tidy layout | 3 to 5 pF | Use as a starting estimate |
Good PCB design rules help here: place the crystal next to the chip, keep both traces equal and short, and run no fast signals under them. A solid ground plane under the oscillator gives a stable, repeatable stray value from board to board.
Solved Example: 12 pF Crystal on a Microcontroller
A 12 MHz crystal rated for 12 pF on a board with about 4 pF stray capacitance needs two 16 pF capacitors. The working below also shows what happens if you fit the nearest E12 value of 15 pF instead.
C = 2 × (12 minus 4) = 16 pF each
Check: 16 ÷ 2 + 4 = 12 pF
With 15 pF fitted: 15 ÷ 2 + 4 = 11.5 pF
Δf/f = (C1m ÷ 2) × [1 ÷ (C0 + 11.5) minus 1 ÷ (C0 + 12)]
C1m = 7 fF, C0 = 3 pF: 8.0 ppm high = 96.6 Hz
Here C1m is the motional capacitance and C0 is the shunt capacitance of the crystal, both printed in a good datasheet. A 12 MHz crystal running 8.0 ppm fast still sits well inside a typical 20 or 30 ppm tolerance, so 15 pF is acceptable for most clocks.

The curve shows why errors are not symmetric. Each picofarad below the rated crystal load capacitance pulls the frequency up more than a picofarad above it pulls it down, and at 12 pF the slope is about 15.6 ppm per pF for this crystal.
What Happens If Load Capacitors Are Wrong?
Wrong load capacitors shift the frequency by tens of ppm and, if far too large, can stop the oscillator from starting. Too much capacitance makes the clock slow, too little makes it fast.
The most common mistake is to fit two 24 pF parts because the crystal says 12 pF, forgetting the stray term. Then CL becomes 16 pF and our example crystal runs 49.1 ppm slow, about 589.5 Hz low at 12 MHz, which is outside a 30 ppm part.
| Symptom | Likely cause | Field fix |
|---|---|---|
| Clock slow, RTC loses time | Load too high, stray ignored | Reduce both capacitors one step |
| Clock fast, RTC gains time | Load too low or caps missing | Increase both capacitors one step |
| No start at cold or low voltage | Large caps, high ESR, low gain margin | Smaller caps or lower ESR crystal |
| UART framing errors at high baud | Clock error adds to baud error | Bring clock within tolerance |
| Works on bench, fails in field | X7R or Y5V caps drifting with heat | Replace with C0G parts |
- Calculate from the crystal CL and a real stray estimate
- Use C0G or NP0 ceramic capacitors with 5 percent or better tolerance
- Measure on a buffered clock output with a frequency counter
- Check gain margin when you raise the capacitor value
- Copying 22 pF from an old schematic
- Using X7R parts that drift with temperature and voltage
- Probing the crystal pins with a 10 pF scope probe
- Ignoring internal load capacitors already in the chip
How to Measure and Tune the Crystal Frequency on the Bench
Measure the frequency on a buffered clock output pin or a timer output with a frequency counter, then adjust both capacitors together until the error is within the crystal tolerance. Never measure directly on the crystal pins.
Most microcontrollers can route the main clock, or a divided copy of it, to a spare pin. A counter with a stable timebase reads it without loading the crystal, while a scope probe on XIN or XOUT adds its own capacitance.

- Let the board warm up for a few minutes before you read the counter
- Record frequency in Hz and convert to ppm: (measured minus nominal) ÷ nominal × 106
- If fast, step both capacitors up; if slow, step both down
- Repeat at minimum supply voltage and at a cold start
A 32.768 kHz watch crystal that runs 20 ppm off gains or loses about 1.7 seconds per day, which adds up to almost a minute each month on a real time clock.
For a new design, also confirm the oscillator has enough gain. The critical transconductance is gm crit = 4 × ESR × (2πf)2 × (C0 + CL)2, and a gain margin of at least 5 against the inverter gm is a common target for MHz crystals.
Start up trouble is easier to see than frequency error. Power the board from a slowly rising supply in a cold room; if the clock fails there, reduce the capacitors or pick a crystal with lower ESR before you chase ppm.
Which Capacitors and Layout Work Best for Crystal Load Capacitors?
Use C0G (NP0) ceramic capacitors, 5 percent or better, placed right next to the crystal with short ground returns. Unlike the class 2 parts in our guide to capacitor types, their value hardly changes with temperature or voltage, so the crystal load capacitance stays where you set it.
Keep the oscillator away from switching nodes and noisy buses. The same noise reduction techniques for digital ICs apply: a guard ring of ground copper around the crystal and no fast traces crossing under it.
If you check the clock against a reference, our calibration error calculator helps you express the reading in percent or ppm against your tolerance.
The video walks through the crystal model and the Pierce circuit, which makes the crystal load capacitance formula above easier to picture.
Crystal Load Capacitance FAQ
Crystal load capacitance is the capacitance across the crystal pins at which the maker calibrated its frequency, typically 6 to 20 pF.
Your circuit must recreate that load with two capacitors plus stray capacitance. If it does not, the crystal runs a few to many ppm away from the value printed on it.
Estimate stray capacitance, say 4 pF, and subtract it from 12 pF to get 8 pF. Double it, because C1 and C2 are in series, so each capacitor is 16 pF. Check: 16 ÷ 2 + 4 = 12 pF.
C0 is the fixed capacitance of the crystal electrodes and holder, typically 1 to 7 pF, and it is part of the crystal itself.
Crystal load capacitance is what the external circuit adds across the pins. You set it with C1, C2 and the stray capacitance of the pins and traces.
Too large and the clock runs slow and may fail to start, because the inverter needs more gain. Too small and the clock runs fast.
In our example, two 24 pF parts on a 12 pF crystal give a 16 pF load. The 12 MHz clock then runs 49.1 ppm slow, about 589.5 Hz low.
Use C0G or NP0 ceramic capacitors with 5 percent tolerance or better, in values from about 6 to 33 pF.
Their value stays almost constant with temperature and DC voltage. X7R and Y5V parts drift with heat and bias, so the crystal load capacitance moves and the oscillator frequency moves with it.
Route the clock, or a divided copy, to a buffered output pin and read it with a frequency counter.
A scope probe on the crystal pins adds several pF and pulls the frequency, so the number you see is not the real one. Let the board warm up before you take the reading.
Related Articles
- Crystal Oscillator Working Principle
- Ceramic Resonator Working and Applications
- LC Resonant Circuit Frequency
- How Decoupling Capacitors Work
- Capacitor ESR Explained
External References
- AN2867 Oscillator design guide for STM8 and STM32 microcontrollers (PDF)
- Calculating load capacitance for quartz crystal resonators
- Pierce oscillator, Wikipedia
What We Learn Today
- Crystal load capacitance is the load the maker calibrated the crystal at, and the circuit must copy it to get the printed frequency.
- In a Pierce oscillator each capacitor equals two times the crystal CL minus the stray capacitance, so a 12 pF crystal with 4 pF stray needs 16 pF.
- Too much load makes the clock slow and can stop start up, too little makes it fast, so measure on a buffered output and adjust.

