Crystal Oscillator Load Capacitance
The crystal’s data sheet specifies a load capacitance (CL) — the total external capacitance the crystal expects to see. Two external capacitors (CL1 and CL2) connect from each crystal pin to ground. Their series combination plus stray PCB capacitance must equal CL.
Inv — Inverting amplifier (built into the microcontroller or oscillator IC). Provides the gain that sustains oscillation.
Rf — Feedback resistor. Biases the inverter into its linear region so it can amplify. Typically 1–10 MΩ.
XI — Crystal input pin (connects to inverter input).
XO — Crystal output pin (connects to inverter output).
CL1 — Load capacitor on the input side, from XI to ground.
CL2 — Load capacitor on the output side, from XO to ground.
Cstray — Parasitic capacitance from PCB traces, pads, and IC pin capacitance. Typically 2–5 pF.
Crystal Load Capacitance Calculator
Every quartz crystal specifies a load capacitance (CL) on its data sheet — typically 12.5 pF, 18 pF, or 20 pF. This is the total capacitance the crystal expects to see across its pins to oscillate at its rated frequency. Wrong load capacitance shifts the frequency: too much pulls it lower, too little pushes it higher. This calculator finds the correct external capacitor values, rounds to the nearest standard part, and verifies the match.
The Formula
When CL1 = CL2 = Cx (symmetric, most common):
CL = Cx/2 + Cstray
Cx = 2 × (CL − Cstray) — the value you need for each capacitor
CL1 and CL2 connect from each crystal pin to ground. From the crystal’s perspective they are in series, and the stray PCB capacitance adds in parallel with that series combination.
Calculator Inputs
CL (Crystal Load Capacitance) — from the crystal data sheet, in pF. Common values: 8 pF (low-power 32.768 kHz), 12.5 pF (STM32, ESP32, modern MCUs), 18 pF (8–25 MHz MCU crystals), 20 pF (older or higher-frequency designs).
Cstray (Stray Capacitance) — parasitic capacitance from PCB traces, pads, vias, and IC pin capacitance. Estimates: 2–3 pF for a tight 4-layer layout, 3–5 pF for a standard 2-layer board, 5–7 pF for loose layouts with long traces. When in doubt, use 3 pF.
Worked Example — 18 pF Crystal, 3 pF Stray
The most common combination for 8–16 MHz microcontroller crystals.
Nearest standard (E12): 33 pF
Verify: CL(actual) = 33/2 + 3 = 16.5 + 3 = 19.5 pF
Error: (19.5 − 18) / 18 = 8.3% — yellow status, slight frequency pull
33 pF is the closest standard value but overshoots by 8.3%. For tighter accuracy, use 27 pF: CL = 27/2 + 3 = 16.5 pF, error = −8.3% (undershoots by the same amount but in the other direction). Neither is perfect — this is where the calculator’s verification mode helps you compare options.
Worked Example — 12.5 pF Crystal, 3 pF Stray
Common for STM32, ESP32, and many modern microcontrollers.
Nearest standard: 18 pF
Verify: CL(actual) = 18/2 + 3 = 9 + 3 = 12.0 pF
Error: (12.0 − 12.5) / 12.5 = −4.0% — yellow, acceptable
Or use 20 pF: CL = 20/2 + 3 = 13.0 pF, error = +4.0%. Both are within the yellow zone. For USB applications requiring tighter frequency tolerance, 18 pF is the safer choice (running slightly fast is better than slightly slow for USB clock recovery). For more on how capacitance values relate to the 3-digit marking on the capacitor body, use the Capacitor Code Calculator.
Worked Example — 20 pF Crystal, 5 pF Stray
Older designs or larger PCBs with more parasitic capacitance.
Nearest standard: 33 pF or 27 pF
With 33 pF: CL = 33/2 + 5 = 21.5 pF → +7.5% error
With 27 pF: CL = 27/2 + 5 = 18.5 pF → −7.5% error
Neither standard value gives a green match. Options: use asymmetric capacitors (e.g. CL1 = 27 pF, CL2 = 33 pF → series = 14.85 pF + 5 pF stray = 19.85 pF, error = −0.75%), or accept the yellow status if frequency accuracy is not critical for the application.
Verify Mode — Checking an Existing Design
Enter CL1, CL2, Cstray, and the crystal’s target CL. The calculator uses the full series formula for asymmetric values:
Example: CL1 = 22 pF, CL2 = 22 pF, Cstray = 3 pF, target = 12.5 pF
CL = (22 × 22) / (22 + 22) + 3 = 484/44 + 3 = 11 + 3 = 14.0 pF
Error: +12% — red status, frequency will be pulled noticeably low
This mode catches a common mistake: using 22 pF capacitors for a 12.5 pF crystal because “22 pF is close to 12.5 pF.” It is not — the series combination plus stray gives 14 pF, overshooting by 12%. The correct value is 18–20 pF.
Common Crystal Load Capacitance Values
| Crystal CL | Typical Use | Cx (at 3 pF stray) | Nearest Standard |
|---|---|---|---|
| 8 pF | 32.768 kHz RTC crystals | 10 pF | 10 pF |
| 12.5 pF | STM32, ESP32, modern MCUs | 19 pF | 18 pF or 20 pF |
| 18 pF | 8–16 MHz MCU crystals | 30 pF | 27 pF or 33 pF |
| 20 pF | Older designs, high-freq | 34 pF | 33 pF |
Estimating Stray Capacitance
Cstray is the sum of PCB trace capacitance, pad capacitance, via capacitance, and the MCU’s oscillator pin capacitance. It is the least precise input in the calculation.
2–3 pF — tight 4-layer PCB, short traces (<5 mm), crystal placed directly next to the MCU, guard ring around crystal pads.
3–5 pF — standard 2-layer board, moderate trace lengths (5–15 mm), typical hobby or production PCB. Use 3 pF as default.
5–7 pF — loose layout, long traces (>15 mm), ground plane close to the crystal traces, or breadboard prototyping.
If you can measure the actual stray capacitance (using an impedance analyser or by measuring the oscillator frequency offset and working backwards), the calculator gives a more accurate result. For most designs, the 3 pF estimate is close enough.
Match Status
Yellow — 1–5% off. Oscillator works, frequency slightly shifted. Acceptable for UART, SPI, I2C. May be marginal for USB.
Red — more than 5% off. Noticeable frequency drift. Consider a different standard value, asymmetric capacitors, or verify your stray capacitance estimate.
Frequently Asked Questions
Last updated: March 2026