# Peak fitting online for Raman, XRD, FTIR and XPS spectra

> Paste a spectrum and fit overlapping peaks: Gaussian, Lorentzian, Voigt or pseudo-Voigt with a baseline. Centre, FWHM and area ± SE. Free, no sign-up.

URL: https://www.labcanvas.com/tools/peak-fitting-online

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γ.

## Quick answer

- **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:** y(x) = baseline + Σ peaks; Gaussian A/(σ√(2π)) e^(−(x−c)²/2σ²), FWHM 2.355σ; Lorentzian (A/π) γ/((x−c)² + γ²), FWHM 2γ; pseudo-Voigt η·L + (1−η)·G
- **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.

Free, in the browser, no account needed. Updated 2026-11-17.

## Features

- Paste two columns (x and intensity) or drop a CSV, TXT, XY, JCAMP-DX (.jdx) or SPC file; Raman, FTIR, XRD, XPS, UV–vis or PL
- Peaks found automatically, with shoulders from the second derivative, or from your own list of positions and labels
- Gaussian, Lorentzian, Voigt (exact, Faddeeva function) or pseudo-Voigt line shapes; one shared width as an option
- Baseline fitted with the peaks: none, constant, straight line or quadratic; fit only an x range
- Table of centre, height, area, % of area and FWHM ± SE, 95% confidence intervals, R², reduced χ², AIC and BIC
- The spectrum with the filled components, the envelope, the baseline and the residuals; FTIR and XPS axes run high to low
- Copy the peak table (pastes into Excel) and a methods sentence; PNG at 300 or 600 dpi; CSV

## How to use it

1. **Paste or drop your spectrum**: Choose the spectrum type (it sets the axis, its direction and a usual line shape), then paste two columns or drop the file.
2. **Choose the line shape**: Lorentzian for Raman phonon bands, Gaussian for FTIR bands of solids, Voigt or pseudo-Voigt for XRD and XPS.
3. **Let it find the peaks or list them**: The automatic search finds peaks and shoulders above a prominence (More options). To fit known bands, list their positions, one per line, with a label.
4. **Check and export**: Look at the residuals: a pattern means a missing peak or the wrong shape. Then copy the table or download the plot.

## 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 |

## How it works

$$y(x) = b_0 + b_1 x + \sum_{k=1}^{K} f_k(x; A_k, c_k, w_k)$$

$$\mathrm{FWHM_{Gauss}} = 2\sqrt{2\ln 2}\,\sigma$$

$$\mathrm{FWHM_{Voigt}} \approx 0.5346\,f_L + \sqrt{0.2166\,f_L^2 + f_G^2}$$

**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 \(\eta L + (1-\eta)G\) of one width. Standard errors come from the covariance matrix; 95% CIs are value ± t × SE.

**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](https://www.labcanvas.com/tools/xrd-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](https://doi.org/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](https://doi.org/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](https://doi.org/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 |



## 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.
