Guide · XRD Rietveld refinement · Complete guide
Rietveld refinement online: the complete guide
What each step of a Rietveld refinement does, how Auto refine decides, how to tell a good fit from a bad one, and every control for the cases that need more, from dopants to a known composition. Worked through on the built-in sample, a simulated Cu Kα pattern of anatase and rutile (TiO2). The tool runs GSAS-II on our server; you need only a browser.
Contents
- What Rietveld refinement does
- Why refine here instead of in GSAS-II by hand
- 1. Prepare the files
- 2. Load and check
- Radiation and polarization
- 3. Set the fitting range
- 4. Refine: Auto refine
- How Auto refine decides
- Several phases: all together or one after the other
- Adding or removing a phase later
- 5. The run list
- 6. Judge the fit
- 7. Settings for special samples
- Peak position correction
- Background
- Texture (preferred orientation)
- Crystallite size and microstrain models
- Dopants, cation mixing and vacancies (site models)
- Expert: every parameter, fixed values, ranges and formulas
- Known composition and amorphous content
- 8. Read the results
- 9. Export
- 10. Step by step
- Common mistakes
- Try it
The short version
- Load the raw pattern and one CIF per phase; check the radiation.
- Limit the fitting range to where the peaks are.
- Press Auto refine. It refines in the classic order and keeps a step only when the fit improves and every value stays physical.
- Judge the fit by the difference curve, by Rwp against the lowest possible Rwp, and by GOF.
- For special samples, add what the sample needs: texture, a size or microstrain model, a dopant or vacancy model, fixed values, a known composition.
- Read the results; export tables, refined CIFs and the GSAS-II project.
What Rietveld refinement does
A Rietveld refinement calculates the whole powder pattern from a structural model, one crystal structure per phase plus the instrument and the background, and adjusts the model's parameters until the calculated pattern matches the measured one point by point. What you get back are the refined parameters: lattice parameters, phase fractions, crystallite size and microstrain, atom positions and displacement parameters, each with an uncertainty.
It refines a model; it does not find one. The phases must be known, as CIF files, before you start. If you do not know them yet, run phase identification first: it searches a library of known structures for the phases that explain your peaks and sends them here with Send to Rietveld refinement →.
Why refine here instead of in GSAS-II by hand
The engine is GSAS-II, the open-source Rietveld program of the Advanced Photon Source at Argonne National Laboratory, unmodified. What differs is how you use it: in GSAS-II every step is yours to operate and to judge; here that work is already done for you.
One click refines the whole pattern. Auto refine releases the parameters in the order an experienced user would: background, scale and zero; lattice; peak shape; asymmetry; atomic coordinates; Uiso. A step is kept only when the fit gets better and every value stays physical; otherwise it is undone. Several phases are refined together or one after the other. You do not need to know what to release next, and a step that diverges cannot spoil the model.
No software to learn first. Nothing to install, no GSAS-II interface to learn, no order of steps to remember. Every step says what it does, what a good result looks like and what to do if it is not. When the fit is poor, the tool says in words where the cause most likely lies: the background, a missing phase, the intensities, the positions or the peak shape.
Every step is kept; nothing is overwritten. GSAS-II writes each refinement into the current project; going back several steps usually means a copy you saved yourself or a backup file. Here every run is saved automatically: view the fit of any run, roll back to before any step, or start over, and the earlier results are still there.
The same results as GSAS-II. Every value and uncertainty is calculated by GSAS-II. Export the GSAS-II project (.gpx) and open it in GSAS-II on your computer: you see the same model and the same numbers, and you can carry on refining there.
The controls for complex samples are all there. Expert mode lists every parameter GSAS-II can refine on the project, and more:
- fixed values, ranges, and linear formulas between parameters;
- a known composition, and the amorphous content from an internal standard;
- dopant, cation-mixing and vacancy models;
- texture (March-Dollase and spherical harmonics), and direction-dependent crystallite size and microstrain.
In GSAS-II these usually mean editing constraints or writing a script; here you type a number or press a button, and Auto refine obeys them too.
Easy for newcomers, quicker for experts. A newcomer presses Auto refine and gets a sound result. An expert lets Auto refine lay the groundwork, then adjusts only what matters in Expert mode.
Your computer stays free. The refinement runs on our server; close the tab and come back later, the project is still there.
Straight from phase identification. The phase identification tool hands the identified phases and their CIFs over with one click, Send to Rietveld refinement →.
On a reference mixture of known weighed composition, sample 1a of the IUCr round robin on quantitative phase analysis (corundum / fluorite / zincite weighed at 1.15 / 94.81 / 4.04 wt %), Auto refine alone gives 1.28 / 94.75 / 3.97 wt %.
This tool refines X-ray powder patterns. For neutron, time-of-flight, single-crystal and magnetic refinements, use GSAS-II itself.
1. Prepare the files
The pattern. Upload the file your diffractometer wrote, or its plain export. The tool reads:
- two-column text (2θ, intensity, optionally σ): .xy, .xye, .dat, .txt and .csv, with or without header lines, with decimal commas, in UTF-8 or UTF-16, including the CSV export of PANalytical software;
- PANalytical .xrdml;
- Bruker .brml and .raw (RAW1.01, RAW2 and RAW4);
- Rigaku .ras and binary .raw;
- GSAS .fxye, .gsa and .xra.
Anything else: export it as two-column text. Use the raw counts, not a smoothed or background-subtracted curve: the refinement fits the background itself and weighs every point by its counting noise. The tool warns when a pattern looks processed.
One CIF per phase. From a database (the Crystallography Open Database, ICSD, the Materials Project), from a paper's supporting information, or from the phase identification tool (right-click a phase, Download CIF). A close structure is fine to start with: the lattice parameters refine; the atoms only need to be roughly right.
2. Load and check
Open the XRD refinement tool and press Try with sample data, or drop your pattern and CIFs onto Drop files here (together or one by one). Each CIF becomes a phase under Phases. The order there is the phase order in every table: put the main phase first. The arrows reorder, × removes.
The right column walks through the refinement in nine parts. Part 1, Know your files, lists what was read: the pattern's range and number of points, each phase with its space group and starting cell, and the radiation. Check them, then press Files look right, start →.
Above the parts, Lowest possible Rwp is already shown. It comes from the counting noise of your data alone, before any fitting, and it is the yardstick for the rest of the guide.
Radiation and polarization
Radiation offers what the file states (xrdml, ras, Bruker raw / brml and the PANalytical CSV carry it), the usual tubes (Cu, Co, Mo, Fe, Cr and Ag Kα1+2; Cu and Mo also Kα1 only; Cu with the extra W Lα line of an ageing tube) and Other wavelength… for anything else, such as a synchrotron. A wrong choice puts every reflection in the wrong place, or gives every peak a shoulder that is not there.
With Other wavelength… there is a Source choice: Laboratory tube (polarization 0.7, a tube with a monochromator) or Synchrotron (polarization 0.99), preselected when the wavelength is no tube's. Polarization changes how intensities fall with angle, so it matters for Uiso and site occupancies much more than for Rwp.
3. Set the fitting range
Part 2, Fitting range, asks where to fit. Fit from just below the first peak to where the peaks fade into noise. Two regions often do harm: the steep low-angle slope from the direct beam, and a long noisy high-angle tail. Both slow the refinement down and pull the background model away from where it matters.
A peak that belongs to no phase of your list (the sample holder, a film, an unknown impurity) can be cut out with an Excluded regions entry instead of being forced into the model. Auto refine also finds one or two such narrow peaks by itself at the end (below).
4. Refine: Auto refine
Press Auto refine and confirm with Run all steps. It runs the classic order of a manual refinement, one block of parameters at a time:
- Background + scale + zero: the background polynomial, the scale of each phase (from which the phase fractions come) and the peak position correction.
- Lattice parameters: peak positions.
- Profile parameters: peak widths and shapes, which carry crystallite size and microstrain.
- Peak asymmetry: the low-angle tail of peaks from the instrument.
- Atomic coordinates: atom positions that the space group leaves free, which change peak intensities.
- Displacement (Uiso): thermal and static disorder, which damps the high-angle intensities.
Pause stops after the step that is running.
The dialog has a few choices; the defaults suit most patterns:
- Phases: all together or one after the other, in this order (next section). Per phase, amount only refines just its scale.
- Leave out: atom coordinates and Uiso. Leave them out for weak or noisy patterns, where they cannot be determined and only add noise.
- Texture stays off. Tick a phase only if its crystallites are plates or needles that lie in a preferred orientation in the holder.
- Keep every peak in the fit: tick it if you do not want narrow peaks of no phase left out.
How Auto refine decides
A run is kept when Rwp is not more than 0.05 points above the accepted model, GSAS-II did not diverge, and no value is unphysical: a phase fraction outside 0 to 100 %, a Uiso outside 0 to 0.08 Ų for an atom the run could move, a value the engine had to clamp. A run that fails is left in the list as discarded, and the next step starts from the last accepted model.
Some steps run only inside Auto refine, and only when their condition is met:
- More background terms (18, then 24) when Rwp drops by at least 0.3 points and 3 % without moving any scale.
- Texture for a cubic metal: when the peak heights of a cubic metal or alloy are spread in the pattern of a bulk piece, sheet or foil, spherical harmonics of order 6 are tried, and kept only when Rwp drops by at least 1 point and 15 %. Every other phase gets texture only with your tick.
- Uiso in up to three tries: each atom its own Uiso; then one Uiso per phase if an atom ran outside 0 to 0.08 Ų; then a surface-roughness term if that common Uiso runs to zero. Any of them is refused if it moves a phase amount by more than 3 wt %.
- A second crystallite size and microstrain: for a non-cubic phase of at least 10 wt % with a measurable size, one value across c* and one along it, kept only when Rwp drops by at least 0.1 points and 2 % and no amount moves by more than 3 wt %.
- Peaks of no phase: on a good fit (GOF up to 2), one or two narrow peaks that no phase explains are left out of the fit, and the result says where. Three or more mean a missing phase and stay in.
Several phases: all together or one after the other
With all together (the default) each step releases its parameters for every phase at once: one run per step.
With one after the other, in this order, the background and every scale are refined first; then the first phase goes through lattice, profile, atomic coordinates and Uiso, then the second phase, and so on. Peak shape terms that belong to no phase go with the first phase; extra background terms and texture come after the last phase. Each run is judged by the same rules, and what was accepted stays released for the later runs. Put the main phase first. It takes about as many times longer as there are fully refined phases, and it is steadier when a minor phase is weak or its peaks overlap the main phase.
amount only on a phase refines only its scale (its cell, size and atoms stay as in the CIF): useful for a minor phase or an internal standard you trust.
Adding or removing a phase later
Changing the phase list makes a new project. When an earlier project of the same pattern has a refined model, the tool offers Keep the refined model or Start from the CIFs. Keeping it carries over every refined value of the phases both lists have (cell, scale, size, strain, texture, atoms, site models) and the instrument values; a new phase starts from its CIF with a small scale. Auto refine then continues from that model instead of starting over.
5. The run list
Every refinement, automatic or by hand, is a numbered run in the middle column, with its Rwp, χ², GOF and number of parameters, and a mark: accepted or discarded. The current model is the last accepted run.
View shows that run's fit; Roll back to before returns the model to the state before that run. Undo takes back the last run; Restart starts again from the CIFs. Nothing is lost by trying.
6. Judge the fit
Judge in this order:
- The difference curve (observed minus calculated, under the plot). It should look like noise around zero. A peak-shaped wiggle points at its cause by its shape: a sharp up-and-down at a peak means the position or width is off; a bump where no tick mark stands means a missing phase; peaks of one family all too strong or too weak suggest texture.
- Rwp against the lowest possible Rwp. Rwp is the weighted misfit in per cent; the lowest possible Rwp (often written Rexp) is the misfit that pure counting noise would leave. They should be close. On the sample: 7.68 % against about 7.3 %.
- GOF, their ratio (χ² is its square). Near 1 means the remaining misfit is noise. Clearly above 2 means the model still misses something.
Rwp alone says little: a pattern with few counts gives a high Rwp for a perfect model, and a pattern with a huge background gives a low Rwp for a poor one. That is why the tool always shows it next to the lowest possible Rwp.
When Rwp is 10 % or more, or GOF 2 or more, Results adds a diagnosis in words: which part of the misfit is largest (background, peaks of no phase, intensities, positions or peak shape) and what usually causes it. Explain this result reads the numbers on screen to you in plain language. If Rwp still will not go down, Ask for a free review sends the refinement to us; the answer comes to your messages and by e-mail.
7. Settings for special samples
Auto refine covers most powders. The settings below are for the samples that need more. They are in Step by step (the step they belong to) and in Expert, and every later run obeys them, Auto refine included.
Peak position correction
Zero shift (instrument) moves every peak by the same angle: transmission or capillary data, or a zero calibrated on a standard. Sample displacement (specimen height, Bragg-Brentano) is the usual error of laboratory reflection data, a shift that changes with angle. The two are strongly correlated, so one is refined.
Background
Background terms sets the Chebyshev terms (12 by default): raise it to 16 to 24 for an amorphous hump or a curved low-angle background, lower it for a short, clean pattern. Edit by hand lets you click anchor points under the pattern: Keep exactly as drawn, or let 4 Chebyshev terms fine-tune it. Back to automatic returns to the polynomial.
Texture (preferred orientation)
Texture is off unless you ask for it, because a texture model fitted to a random powder absorbs a peak-shape error and gives wrong amounts. Switch it on for plates or needles that lie flat in the holder, for pressed pellets, sheets and foils. In the profile step, Preferred orientation has a model per phase:
- March-Dollase (one axis): one coefficient along one direction you choose (00l for plates is typical).
- Spherical harmonics of order 4, 6 or 8: a general orientation distribution with 3, 5 or 8 coefficients, for when March-Dollase leaves both 00l and hk0 wrong.
The result gives the Texture J index of spherical harmonics: 1 means random, above 1.5 strong texture.
Crystallite size and microstrain models
When peak widths depend on direction (a layered compound: 00l broad, hk0 sharp), one size and one microstrain cannot follow them. Peak broadening gives each phase a model:
- Size: isotropic, or uniaxial along [0 0 1], [1 0 0], [0 1 0], [1 1 0] or [1 1 1] (one size along the axis, one across).
- Microstrain: isotropic, uniaxial along the same axes, or generalized (Stephens), the widths of every direction with 2 to 15 terms depending on symmetry.
Cubic phases have no uniaxial choice. The chosen model is tried by the next run that refines that phase's size or microstrain; Auto refine never changes a model you chose.
Dopants, cation mixing and vacancies (site models)
A doped or non-stoichiometric compound has the structure of its parent with different atoms, or fewer, on some sites. In the atomic coordinates step, Site models adds one refined value per model:
- + Dopant…: an element shares a host site (Nb on the Ti site, say). You give the host site, the dopant, a start fraction and a maximum. The site stays as full as in the CIF.
- + Cation mixing…: two elements swap places between two sites (Li and Ni in a layered cathode). x is the fraction exchanged.
- + Occupancy (vacancies)…: how full one site is, between 0 and a maximum, with nothing added (x in NaxTiS2). Its Uiso is held while the occupancy is refined, because the two change the intensities the same way.
Tick the new value to refine it. The result states the refined composition, with its uncertainty, and warns when a value sits at its limit or is poorly determined. Site models need a settled profile: add them after the profile step. Auto refine never adds one by itself.
Expert: every parameter, fixed values, ranges and formulas
Expert is one table of every parameter GSAS-II can refine on this project: instrument and sample (zero, displacement, U V W X Y, asymmetry), every background term, and per phase the scale, each cell parameter, size, microstrain, texture, each site model, and x, y, z and Uiso of each atom. Tick what to refine and press Run selected; then Accept keeps the result, Discard leaves the model as it was.
- Fix a value. Type a value in the box next to a parameter, or press the pin to fix it at the value it has. No run refines it after that (Expert, the guided steps, Auto refine) until you free it with × or an empty box. Use it for a value you know: a lattice parameter from a standard, a Uiso from the literature, a size you measured otherwise.
- Ranges. Switch Ranges on to give a parameter a lower and an upper limit. A value that runs outside is put on the limit, held there and the run repeated; the result says "On the limit of your range".
- Formulas. A box of a coordinate, a Uiso or a scale also takes a linear formula starting with "=", such as = 0.5 - [S1 z]: while you type, click the row it refers to. Use it to tie two atoms' Uiso, keep two coordinates related, or hold the ratio of two scales.
- Locked rows. A coordinate the site symmetry fixes, a cell length equal to another by symmetry, or a hydrogen Uiso cannot be ticked; the lock says why.
When you fixed or typed values that the accepted model does not have yet, Auto refine starts with a run "Values fixed by you" and judges every later step against the model with your values.
Known composition and amorphous content
Known composition (at the top of Expert) is for a weighed mixture: type the amount of each phase you know, Weight or Moles (with the formula one mole stands for), and every run keeps that ratio while the other phases stay free. It needs a first accepted run.
Amorphous content (in Results) uses an internal standard: pick the Phase of known weight, type Its weight in the sample and press Calculate. The other phases are scaled to it, and what is missing from 100 % is amorphous or unidentified. Once a standard is set, Auto refine also refuses a step that would make that amorphous content negative.
8. Read the results
Under Results, each phase has a card with its weight fraction, cell, preferred-orientation factor, crystallite size and microstrain; then come the distances, bond lengths and angles.
- Weight fractions come from the refined scale factors (the Hill–Howard relation) and are relative among the crystalline phases in the model. Amorphous material and phases missing from the list are not counted; for absolute amounts, use an internal standard (above).
- The uncertainties (±) are GSAS-II's estimated standard deviations: they measure the statistics of the fit, not every systematic error, and are usually smaller than the real error.
- Size shown as >200 nm means the peaks are as narrow as the instrument makes them: the crystallites are too large to measure from the broadening.
9. Export
Under Export, tick what you need and press Export selected:
- Fit plot (PNG) and the fit curve as CSV (2θ, observed, calculated, background), for your own figure.
- Refined phases and all parameters as CSV, for the tables of a paper.
- The refined CIF of each phase, with uncertainties.
- The GSAS-II project (.gpx), to check or continue the same refinement in GSAS-II on your computer.
- The project file (JSON), to reopen this session here later.
Open in Plot turns the fit into a journal-ready figure for free. From Plot, Open in Origin (.slplot) gives a file that you drag into Origin (2021 or later, with the free ScienLytic app for Origin installed): Origin draws the same figure as an ordinary, fully editable Origin graph with its workbook, almost identical to the one in Plot.
Exports belong to the run being viewed, so you can also export an earlier run. On your own data the fit, Rwp, GOF and the fit plot are always free; the refined numbers and the files are unlocked per dataset. The sample is always unlocked.
10. Step by step
Step by step runs the same nine parts one at a time, with what each does, what a good result looks like and what to do if it is not. You choose what to release in each step, then Accept or Discard the run; Accept, stay here keeps it and lets you release more in the same step. All together or One at a time decides whether a step refines every phase at once or one phase per run. Use it to learn, or when Auto refine discards a step you want to understand.
Common mistakes
- Too many phases at once. Five candidate phases, two of them far below 1 wt %, make an unstable refinement. Start with the main phase, add one phase at a time, and keep it only if Rwp drops clearly and its peaks are visible in the difference curve.
- Fitting the whole measured range. The direct-beam slope at low angle and a noisy high-angle tail add nothing but time. Set the fitting range to where the peaks are.
- Refining atoms on weak data. On a weak or noisy pattern, atom positions and Uiso cannot be determined; leave them out in the Auto refine dialog.
- A wrong radiation or polarization. A Kα1-only instrument fitted as Kα1+2 (or the reverse) gives doubled or missing shoulders on every peak; synchrotron data refined with a tube's polarization gives wrong Uiso and occupancies.
- Texture on a random powder. It lowers Rwp a little and moves the amounts. Use it only for plates, needles, pellets, sheets and foils.
- Uploading processed data. A smoothed or background-subtracted pattern makes Rwp, GOF and the amounts unreliable. Upload the file the diffractometer wrote.
- Reading the weight fractions as absolute. They are fractions of the crystalline phases in the model. An amorphous part or a missing phase changes the real amounts without changing these; use an internal standard.
Try it
Open the XRD tool with the sample
In a hurry? The quick start covers the same flow in five steps.



























