Crystal Load Capacitance Calculator
Electronics
- The load capacitance a crystal sees is its two grounding capacitors in series, plus the stray capacitance of pins and board traces.
- Combine C1 and C2 in series: 27 x 27 / (27 + 27) = 13.50 pF.
- Add the stray capacitance: 13.50 + 3.00 = 16.50 pF.
- The load capacitance is 16.50 pF; the crystal sees exactly this capacitance, and it oscillates on frequency only when that matches its rating.
A quartz crystal does not oscillate at its marked frequency on its own. It oscillates at the frequency set by the load capacitance the circuit presents to it, and the crystal was ground and tuned at the factory assuming one specific load, printed on its data sheet as CL. Present a different load and the frequency moves: that is the entire problem this calculator manages.
In the standard Pierce oscillator the crystal sees two capacitors, one from each pin to ground, acting in series, plus a few picofarads of stray capacitance from the IC pins, the pads and the PCB traces. The calculator combines the pair in series, adds the stray, and reports the true load; in reverse mode it solves for the equal pair that hits a target load.
The circuit in question is almost always a Pierce oscillator: an inverting amplifier inside the microcontroller, a feedback resistor, the crystal, and the two capacitors this calculator concerns itself with. It is the default clock source of the embedded world, which makes its one systematic error — the wrong load — a remarkably widespread one.
The examples use the values that recur in real designs: 27 pF capacitors with 3 pF of stray giving a 16.50 pF load, and the common 12.5 pF crystal that wants two 20.00 pF capacitors once stray is accounted for. Getting this right is the difference between a clock that keeps time and one that drifts minutes a month.
Worked examples
Two 27 pF capacitors, 3 pF stray
(Load from C1 and C2 · 27 pF · 27 pF · 12.5 pF · 3 pF)
| Load capacitance / capacitor value | 16.50 pF |
| Series combination of C1 and C2 | 13.50 pF |
| Stray capacitance | 3.00 pF |
| Total load seen by the crystal | 16.50 pF |
Target 12.5 pF, 2.5 pF stray
(Equal C1 = C2 for a target load · 27 pF · 27 pF · 12.5 pF · 2.5 pF)
| Load capacitance / capacitor value | 20.00 pF |
| Target load capacitance | 12.50 pF |
| Series combination required | 10.00 pF |
| Stray capacitance | 2.50 pF |
Two 22 pF capacitors, 5 pF stray
(Load from C1 and C2 · 22 pF · 22 pF · 12.5 pF · 5 pF)
| Load capacitance / capacitor value | 16.00 pF |
| Series combination of C1 and C2 | 11.00 pF |
| Stray capacitance | 5.00 pF |
| Total load seen by the crystal | 16.00 pF |
What load capacitance a crystal actually sees
The two grounding capacitors are not in parallel from the crystal's point of view. Looking back from the crystal's terminals, the path goes through one capacitor to ground and returns through the other, so the pair acts in series: C1 x C2 / (C1 + C2). Two equal capacitors therefore present half of one capacitor's value.
On top of that sits the stray capacitance: the oscillator pins of the microcontroller, the bond pads, the solder mask and the traces all add small capacitances effectively across the crystal. A careful layout keeps strays near 2 to 3 pF; a sprawling one can reach 5 pF or more. The data sheet of the microcontroller sometimes states its internal pin capacitance, which belongs in the same budget.
The series pair plus stray capacitance
The forward calculation is two steps: combine the pair in series, then add the stray. With 27 pF on each side the series combination is 13.50 pF, and with 3 pF of stray the crystal sees 16.50 pF. Fit that pair to a crystal specified at 18 pF and it runs slightly high in frequency, because a lighter load pulls a parallel-resonant crystal upward.
The relationship is gentle but unforgiving over time. Pulling sensitivity for a typical tuning-fork or AT-cut crystal is measured in parts per million per picofarad, and a real-time clock has a budget of only about 20 ppm before it drifts a minute a month. Two picofarads of uncounted stray can consume most of that budget on their own.
- Series pair: CL_pair = C1 x C2 / (C1 + C2); equal caps give C/2.
- Total load: CL = CL_pair + C_stray.
- Lighter load than specified: crystal runs fast.
- Heavier load than specified: crystal runs slow and starts harder.
Worked example: two 27 pF capacitors and 3 pF of stray
The first worked example is the classic textbook layout: 27 pF on both pins and an assumed 3 pF of stray from a compact board. The series pair contributes 13.50 pF and the total load is 16.50 pF. That suits a crystal specified at 16 pF or 18 pF reasonably well, though the 18 pF part will sit a touch high.
The third example shows a common variation: 22 pF capacitors with a pessimistic 5 pF stray allowance give a series pair of 11.00 pF and a load of 16.00 pF. Notice how the larger stray eats the difference between the two capacitor choices almost exactly; layout discipline is worth as much as capacitor selection.
Estimating stray capacitance on your board
Stray capacitance is the one input nobody can look up exactly, so estimate it in layers. The microcontroller's oscillator pins typically contribute 1 to 2 pF in total, which the data sheet or the vendor's oscillator application note often states. Short, direct traces over a ground plane add a few tenths of a picofarad per centimetre; long traces wandering across the board add much more.
A sane default for a compact layout with the crystal hugging the MCU is 3 pF, the value used in the first worked example. A loose layout, a socketed crystal, or test pads on the oscillator lines justify 5 pF, as in the third example. If the frequency matters to better than a few tens of ppm, there is no substitute for measuring one finished board and back-calculating the true stray from the measured error.
- MCU pins: typically 1-2 pF in total.
- Compact layout default: about 3 pF of stray.
- Loose layout, sockets or test pads: 5 pF or more.
- Keep ground pour away from crystal traces if the vendor's layout guide says so: it adds capacitance to ground on both pins.
Solving backwards: capacitors for a 12.5 pF crystal
Design usually runs the other way. The crystal is chosen first, often a 12.5 pF part because that is what the microcontroller vendor's reference design used, and the capacitors must be found. Rearranging the formula, each of an equal pair is twice the load minus twice the stray: 2 x (CL - C_stray).
The second worked example runs exactly that: a 12.5 pF target with 2.5 pF of stray gives 2 x 10.00 = 20.00 pF per side. The nearest standard values are 20 pF itself or 22 pF; choosing 22 pF loads the crystal slightly heavily and pulls it a few ppm low, which for a real-time clock is a deliberate, correctable offset in the digital calibration register.
| Target load CL | Assumed stray | Equal C1 = C2 |
|---|---|---|
| 12.5 pF | 2.5 pF | 20.00 pF |
| 16.00 pF load from 22 pF pair | 5 pF | 22 pF fitted |
| 18 pF | 3 pF | 30 pF |
| 20 pF | 4 pF | 32 pF |
Frequency pulling and starting problems
Load error shows up first as a frequency error, and that is often acceptable: a USB or UART crystal can be off by hundreds of ppm and still work. It shows up second as a starting problem. A crystal loaded far above its specification presents a harder start, especially at temperature extremes and low drive levels, and marginal oscillators fail in the field in winter, not on the bench in June.
If an oscillator is reluctant, check the load before blaming the crystal. Too much load, a drive level above the crystal's rating, or a missing series resistor on a fast microcontroller oscillator are the usual culprits. The negative-resistance margin test in the MCU vendor's application note is the rigorous check; the load calculation here is its necessary first step.
FAQs
What load do two 27 pF capacitors give a crystal?
In series they give 13.50 pF; adding 3 pF of stray capacitance gives a 16.50 pF load. That is the first worked example, and it suits crystals specified at 16 to 18 pF, with the 18 pF part running very slightly fast.
What capacitors do I need for a 12.5 pF crystal?
With 2.5 pF of stray, each capacitor is 2 x (12.5 - 2.5) = 20.00 pF. That is the second worked example. If your layout is loose, assume more stray and step down a value; if it is tight and measured, 22 pF may land closer.
What if my capacitors are 22 pF with 5 pF of stray?
The series pair gives 11.00 pF, so the crystal sees a 16.00 pF load. That is the third worked example, and it shows how a larger stray allowance quietly consumes the difference between capacitor values.
Why does stray capacitance matter so much?
Because it adds directly: 5 pF of stray on top of an 11.00 pF series pair is nearly a third of the 16.00 pF total. Ignoring it is the commonest reason a clock design that calculated correctly still runs at the wrong rate.
Should C1 and C2 be equal?
Usually yes: equal values keep both crystal pins at similar impedance, keep the oscillator's drive symmetric, and make the series formula a simple halving. Deliberately unequal values are occasionally used to adjust drive level, but that is a specialist move with measurement behind it.
What happens if the load capacitance is wrong?
The crystal is pulled off its marked frequency, high if the load is light and low if it is heavy, and at extremes it may start unreliably at temperature corners. The load sets the operating point the crystal was cut for, so match it as closely as the application’s timekeeping budget demands. In production designs the load is often trimmed deliberately: a slightly heavy load plus the microcontroller's digital calibration register can cancel the error of a whole production run at once.