Peak fitting online for Raman, XRD, FTIR and XPS spectra
Paste a spectrum (two columns, or drop a CSV, JCAMP-DX or SPC file) and the tool finds the peaks, including shoulders from the second derivative, and fits them all at once with a straight-line baseline: Gaussian, Lorentzian, Voigt or pseudo-Voigt shapes by nonlinear least squares. You get a table of centre, height, area, % of the total area and FWHM, each ± standard error, with the fitted components drawn under the spectrum. A Gaussian peak’s FWHM is 2√(2 ln 2) σ = 2.355 σ; a Lorentzian’s is 2γ.
- What it does
- Deconvolutes overlapping peaks in a Raman, XRD, FTIR, XPS or UV–vis spectrum: finds them automatically (or from your list) and fits Gaussian, Lorentzian, Voigt or pseudo-Voigt peaks plus a baseline, with centre, area and FWHM ± SE.
- Formula
- Example
- The built-in Raman spectrum of defective graphene (701 points, 1100–1800 cm⁻¹) gives three Lorentzians: D at 1348.1 cm⁻¹ (FWHM 38.0, 49.8 % of the area), G at 1584.0 cm⁻¹ (FWHM 23.8, 42.7 %) and D′ at 1621.0 cm⁻¹ (FWHM 16.2, 7.55 %), R² = 0.998; I(D)/I(G) by area = 1.17.
Last updated
Loading Peak fitting online…
At a glance
| Input | x and intensity (CSV, TXT, XY, JCAMP-DX, SPC) |
|---|---|
| Shapes | Gaussian, Lorentzian, Voigt (Faddeeva), pseudo-Voigt |
| Baseline | None, constant, linear or quadratic, fitted with the peaks |
| Peaks | Automatic (maxima and second-derivative shoulders) or your list |
| Output | Centre, height, area, % area, FWHM ± SE; 95% CIs; R², reduced χ², AIC, BIC |
| Engine | The LabCanvas Graph app’s peak fit, checked against lmfit |
| Runs in | Your web browser; nothing is uploaded |
| Price | Free, no account needed |
What it does
How to use the peak fitting online
- Paste or drop your spectrumChoose the spectrum type (it sets the axis, its direction and a usual line shape), then paste two columns or drop the file.
- Choose the line shapeLorentzian for Raman phonon bands, Gaussian for FTIR bands of solids, Voigt or pseudo-Voigt for XRD and XPS.
- Let it find the peaks or list themThe automatic search finds peaks and shoulders above a prominence (More options). To fit known bands, list their positions, one per line, with a label.
- Check and exportLook at the residuals: a pattern means a missing peak or the wrong shape. Then copy the table or download the plot.
How it works
Finding the peaks. The baseline is first estimated as the line through the ends of the spectrum. Peaks are local maxima above a minimum prominence (5 % of the intensity range by default) and a signal-to-noise ratio, as in SciPy’s find_peaks; with shoulders on, minima of the smoothed second derivative add peaks hidden on the flank of another. After a first fit, peaks the data do not support (area under 0.5 % of the total or under twice its SE, height under three times the residual SD, a width narrower than the point spacing) are dropped and the rest refitted.
Fitting. All peaks and the baseline are fitted together by Levenberg–Marquardt least squares with areas kept positive and centres inside the data. The line shapes are those of lmfit, so each peak’s amplitude is its area: Gaussian, Lorentzian, Voigt (the exact convolution, computed with the Faddeeva function, its FWHM by Olivero & Longbothum 1977) and pseudo-Voigt
Reading the result. Peak areas measure how much of what gives each band (when response factors are similar); centres give positions and shifts; FWHM gives crystallinity, disorder or crystallite size. In Raman of carbons, the D/G area or height ratio tracks defect density. For XRD, put the FWHM into the Scherrer calculator.
Same numbers as the Graph app. The page runs the LabCanvas Graph app's peak-fit analysis, which is checked against lmfit; the hand-off opens the same table and fit there, where peaks can be fixed, linked and edited.
Sources: Newville M et al. LMFIT: non-linear least-squares minimization and curve-fitting for Python. Zenodo, doi:10.5281/zenodo.11813 (line shapes; area = amplitude). Olivero JJ, Longbothum RL. Empirical fits to the Voigt line width. J Quant Spectrosc Radiat Transf 1977;17:233–236, doi:10.1016/0022-4073(77)90161-3. Ferrari AC, Basko DM. Raman spectroscopy as a versatile tool for studying the properties of graphene. Nat Nanotechnol 2013;8:235, doi:10.1038/nnano.2013.46.
Worked example: D, G and D′ bands of defective graphene
The built-in example is a simulated Raman spectrum with noise, not a measurement: the D band at 1348 cm⁻¹ (FWHM 38), the G band at 1584 (FWHM 24) and the D′ shoulder at 1621 (FWHM 16) as Lorentzians on a sloping background, 701 points from 1100 to 1800 cm⁻¹.
| Peak | Centre (cm⁻¹) | Height | Area | % of area | FWHM (cm⁻¹) |
|---|---|---|---|---|---|
| D | 1348.09 ± 0.06 | 620.0 ± 2.1 | 36 983 ± 157 | 49.8 | 37.98 ± 0.20 |
| G | 1584.00 ± 0.04 | 850.0 ± 2.7 | 31 725 ± 134 | 42.7 | 23.76 ± 0.13 |
| D′ | 1620.95 ± 0.12 | 220.8 ± 3.2 | 5 615 ± 109 | 7.55 | 16.19 ± 0.39 |
- Shoulder. D′ sits on the flank of G and has no maximum of its own; the second-derivative search finds it.
- Areas. For a Lorentzian, area = π × height × FWHM / 2: π × 619.98 × 37.976 / 2 = 36 983, the fitted area.
- Ratios. I(D)/I(G) = 36 983 / 31 725 = 1.17 by area and 620.0 / 850.0 = 0.73 by height. Say which one you report.
- Fit quality. R² = 0.998 and the residuals scatter without a pattern.
| Spectrum | Usual shape | Why |
|---|---|---|
| Raman (crystals, graphene) | Lorentzian | Phonon lifetime broadening |
| FTIR of solids and proteins (amide I) | Gaussian | Inhomogeneous broadening dominates |
| XRD | Pseudo-Voigt or Voigt | Instrument (Gaussian) and size (Lorentzian) broadening together |
| XPS | Pseudo-Voigt, about 30 % Lorentzian (GL(30)) | Core-hole lifetime and instrument resolution; see the XPS peak fitting page |
Frequently asked questions
How do I fit overlapping peaks?
Fit all of them together with a baseline: give each peak a shape (Gaussian, Lorentzian or Voigt), start from the visible maxima and shoulders, and let least squares adjust every centre, width and area at once. Check the residuals: a hump means a missing peak. This page does that from a pasted spectrum.
Gaussian, Lorentzian or Voigt: which should I use?
Lorentzian for lifetime-broadened bands (Raman phonons, NMR), Gaussian for inhomogeneously broadened bands (FTIR of solids, amide I), Voigt or pseudo-Voigt when both act (XRD, XPS, Raman of disordered materials). Compare fits by the residuals and AIC, not by R² alone.
How is the FWHM of a peak calculated?
From the fitted width: Gaussian FWHM = 2√(2 ln 2) σ ≈ 2.355 σ; Lorentzian FWHM = 2γ; Voigt FWHM ≈ 0.5346 f_L + √(0.2166 f_L² + f_G²) (Olivero & Longbothum 1977).
How do I calculate the area under each peak?
From the fitted parameters: Gaussian area = height × σ × √(2π); Lorentzian area = π × height × FWHM / 2. The tool reports each area ± SE and as a percentage of the total.
Is this an alternative to Origin or Fityk peak fitting?
For a single spectrum, yes: it does multi-peak least-squares fitting with the same line shapes as lmfit, in your browser, with no install or account. For many spectra, linked peaks and figures, open your data in the LabCanvas Graph app.
How do I calculate the D/G ratio of a Raman spectrum?
Fit the D (about 1350 cm⁻¹) and G (about 1580 cm⁻¹) bands, with D′ (about 1620) if it shows as a shoulder, then divide the D area (or height) by the G area (or height). State which ratio and which laser wavelength you used.
Link to this tool
Using it in a protocol, lab wiki or course page? Copy a link or citation.
<a href="https://www.labcanvas.com/tools/peak-fitting-online">Peak fitting online</a> (LabCanvas)LabCanvas. Peak fitting online [online tool]. https://www.labcanvas.com/tools/peak-fitting-onlineMake the fitted spectrum publication-ready
Your data from this page opens in the LabCanvas Graph app with the same analysis, as an editable graph you can restyle, size to a journal column and place in a figure. The Graph app is free to use with a free LabCanvas account.
Open the Graph app