Home / Science / Physics / Nuclear and particle physics / Spectrum peak fitterTool #951

Spectrum peak fitter: Gaussian peaks on a background, net areas, FWHM and energy calibration for gamma and other spectra

Paste or open a spectrum or histogram (counts per channel), mark a region, find or type the peaks, and fit Gaussians on a constant, straight or quadratic background with Poisson weights: centroid, FWHM, net area and their uncertainties, χ²/ν and residuals. Then calibrate channel to energy from known peaks.

Keep it one tap away for everyday use.

Bookmark Spectrum peak fitter?

Press Ctrl + D now. Your browser opens its own bookmark box, where you choose the name and folder.

  1. Spectrum
  2. Peaks
  3. Fit
  4. Calibrate
Nothing is uploadedWorks offline once open

Spectrum

Region and peaks

Positions are starting guesses in the units of the first column; the fit moves them. Width: a rough full width at half maximum, used to find peaks. Counts are weighted as Poisson (1/counts).

Energy calibration (optional)

Peaks from earlier fits stay as #1, #2 … only while the region is unchanged; for a calibration across the spectrum, type the positions of known peaks as numbers.

For study and planning, not a substitute for professional judgement or validated spectroscopy software. Peak shapes are pure Gaussians (no low-energy tail).

Download

What it does

A gamma-ray, X-ray or alpha spectrum (or any histogram) shows peaks sitting on a background. To measure a peak you need its centroid (where it is), its width (the detector’s resolution) and its net area (how many counts belong to it, which gives the activity). This page fits each peak in a region with a Gaussian on a smooth background:

counts(x) = background(x) + Σ A exp(−(x − μ)² / 2σ²)

by weighted least squares. Each channel is weighted by 1/counts, as Poisson statistics require, so the uncertainties are the counting uncertainties. Overlapping peaks (doublets) are fitted together.

How to use it

  1. Spectrum: paste counts, one per line (the page numbers the channels 0, 1, 2 …), or two columns (channel or energy, then counts), or open a file (CSV, TSV, TXT or Excel, up to 65,536 rows). Nothing is uploaded. The chart shows the whole spectrum, on a log scale if you like.
  2. Region: type where the region starts and ends. Include some background on both sides of the peaks.
  3. Background: constant, straight line (usual) or quadratic (for a curved continuum).
  4. Peaks: type rough positions, separated by commas, or press Find peaks in the region (it uses the typical width you give).
  5. Read the table: centroid, FWHM and net area with their 1σ uncertainties, and the height. Check the residual plot: the points should scatter within ±2σ with no pattern, and χ²/ν should be near 1.
  6. Energy calibration (optional): give pairs of position and known energy, such as #1 662 (fitted peak 1 is the 662 keV line) or 180 300. The table gains energy and FWHM in energy.

Worked example

The page opens with a made-up 1,024-channel spectrum (137,682 counts) and the region 380 to 460 with peaks near 410 and 425: a close doublet on a sloping background. The fit gives centroids 410.59 ± 0.3 and 425.95 ± 0.43, FWHM 14.05 and 12.18 channels, and net areas 4610 ± 200 and 2467 ± 190 counts, with χ²/ν = 1.27 on 73 degrees of freedom. The summation net area of the whole region (gross counts minus a straight-line background) is 7038 ± 280, close to the sum of the fitted areas, 7077.4.

Move the region to 150 to 220 and press Find peaks: one peak at 179.991 ± 0.059 with 8986 ± 130 counts. With the calibration pairs #1 300, 410.585 662 and 700 1120, the line is E = 15.5317 + 1.57713 × channel and the peak’s FWHM is 14.8 keV.

Tips

  • The fitted area uncertainty includes the background under the peak, which is why it is larger than √(area).
  • If χ²/ν is well above 1, look at the residuals: a missing small peak, a curved background, or a low-energy tail (common in germanium detectors) shows up there.
  • For activity, divide the net area by the counting time, the efficiency and the emission probability; the counting statistics helper does the detection limits.

FAQ

Are the uncertainties scaled by χ²/ν? No. They come from Poisson statistics alone, as is usual for counting data. If χ²/ν is much larger than 1, the model is incomplete and the true uncertainties are larger.

Can I fit a whole spectrum at once? Fit one region at a time; up to 8 peaks per region.

Is it suitable for regulated measurements? It is for study and planning, not a substitute for professional judgement or validated spectroscopy software.

Where the numbers come from

  • Weighted non-linear least squares (Levenberg-Marquardt) with Poisson weights, Gaussian peak area A σ √(2π) and FWHM = 2√(2 ln 2) σ: standard results, for example Knoll, G. F., Radiation Detection and Measurement, and Bevington and Robinson, Data Reduction and Error Analysis for the Physical Sciences.
  • Checked against SciPy curve_fit (absolute Poisson sigma) on the same spectrum and NumPy polyfit for the calibration, in tests written for this page.
  • The example spectrum is made up: a falling continuum and four Gaussian peaks with Poisson noise from a fixed seed.

Standard scientific values, such as constants, atomic weights and melting points, are facts found in every textbook; we name where ours were checked. If you are an author or publisher and want a value, a credit or a table changed or removed, tell us and we will act quickly.

Last updated 2026-11-09.

Related tools

Gamma shielding calculator #946 How much a lead, tungsten, steel, aluminium, concrete or water shield cuts a gamma beam from 0.1 to 2 MeV: linear attenuation coefficient, half- and tenth-value layers, narrow-beam transmission, optional buildup, and the thickness for a wanted transmission, with every material compared. The built-in μ/ρ is worked out from formulas, not a table, so it is only an estimate: type the NIST XCOM value for real work. Counting statistics helper #950 For Geiger, scintillation and gamma counting: subtract the background with the right uncertainty, decide whether anything was detected (Currie's decision threshold L_C and detection limit L_D), get the activity and minimum detectable activity, exact Poisson limits, dead-time corrections for both detector models, and the best split of counting time. Calibration curve with LOD and LOQ #28 Paste your standards and get the calibration line, R², limits of detection and quantitation (ICH Q2), and the concentration of each unknown with a 95 % interval. Publication plot maker #27 Paste columns or open a CSV or Excel file and get a clean scientific figure with error bars, sized for a journal column. Download vector SVG or PDF, or PNG at 300 or 600 dpi. Your data stays in your browser. Decay chain simulator #945 Follow a radioactive parent and up to seven daughters through time with the Bateman equations: activity of every member at any time, when each daughter peaks, whether the chain reaches secular or transient equilibrium and how long that takes. Branching, any starting activities, and a chart and CSV of the ingrowth. Relativistic kinematics calculator #947 Four special-relativity calculators in one page, in MeV or GeV with c = 1: the invariant mass of any set of particles, the momenta and lab energy ranges in a two-body decay, a Lorentz boost of a four-momentum in any direction, and the threshold energy of a reaction on a fixed target or in a collider. Type particle names instead of masses.