What Is NIR Spectroscopy? How Near-Infrared Analysis Works

Updated: 21 hours ago
NIR spectroscopy (near-infrared spectroscopy) is a fast, non-destructive way to measure what a sample is made of. An NIR analyzer shines near-infrared light onto a sample, records which wavelengths the sample absorbs, and uses a calibration to turn that pattern into results such as moisture, protein, fat, fiber or starch. A typical analysis takes about 30 seconds, uses no chemicals, and leaves the sample intact.
NIR is used every day in feed mills, forage labs, oilseed crushers, flour mills, pet food and snack plants, dairies and renderers — anywhere people need composition results quickly enough to act on them.
This two-minute overview walks through the whole NIR process.
In this article
What near-infrared light is
What NIR actually measures
How an NIR analyzer reads a sample
Three ways NIR instruments are built
Reading an NIR spectrum
How an NIR calibration is built
Tips for getting accurate results
NIR vs. wet chemistry
What NIR is used for
When NIR is not the right tool
Frequently asked questions
What is near-infrared light?
Near-infrared light sits just beyond the red end of the visible spectrum. Its wavelengths are longer than red light, so our eyes cannot see it. The NIR region runs from roughly 750 to 2,500 nanometers (nm); most food and agricultural analyzers work somewhere between 1,100 and 2,500 nm, where the information about moisture, protein and oil is strongest.

Near-infrared light is invisible to the eye. Grain and feed analyzers commonly measure between 1,100 and 2,500 nm.
What does NIR measure?
NIR can measure any constituent with C–H, N–H, and O–H bonds that are greater than 0.1% in concentration.
Everything in a sample — water, oil, protein, carbohydrates — is made of molecules held together by chemical bonds. Those bonds are always vibrating. When NIR light hits a bond at a wavelength that matches its natural vibration, the light is absorbed. Light at other wavelengths passes through or bounces back out.
The three bonds that matter most in food and agriculture each absorb at their own wavelengths:
Bond | What it tells you | Absorbs near |
O–H | Water (moisture) | 1450 and 1940 nm |
C–H | Oil and fat | 1200, 1725 and 2310 nm |
N–H | Protein | 1510 and 2180 nm |

Each type of chemical bond absorbs NIR light at its own set of wavelengths. That is what lets one scan measure several components at once.
Because these bonds are found in almost every organic material, NIR can measure many constituents in one scan: moisture, protein, fat/oil, fiber (ADF, NDF), starch, sugars and free fatty acids, among others. Ash and minerals don't absorb NIR light directly; they are predicted indirectly through their relationship with the organic components, which works well in some products and less well in others.
How an NIR analyzer reads a sample
The measurement itself is simple:
Present the sample. A ground or whole sample is placed in a cup with a glass window, or the analyzer looks at product moving past a window in the process line.
Shine NIR light on it. A lamp illuminates the sample. The light scatters from particle to particle, and some wavelengths are absorbed along the way.
Record what comes back. A detector measures how much light returns at each wavelength.
Calculate the result. A calibration model converts that pattern into composition values and displays them in seconds.
Most solid samples — grain, meal, forage, pet food kibble, powders and pastes, ground or unground — are measured by diffuse reflectance: the light penetrates the sample, scatters, and part of it bounces back out to the detector. Transmission, where the light passes right through the sample, is used for liquids, whole unground grain, meat and cheese. Transflectance suits liquids and gels: the light passes through a thin layer of sample, reflects off a backing plate and passes back through.
In every case the light only travels a short distance into the sample, usually about 0.1 to 3 mm. That is why consistent sample preparation and packing matter so much: anything that changes how far the light travels changes the spectrum.
Three ways NIR instruments are built
All NIR analyzers record a spectrum, but they separate the wavelengths in different ways. The design affects the wavelength range, speed and how the instrument copes with different sample types.

Scanning monochromator. A rotating grating sends one narrow band of light to the sample at a time and builds the spectrum point by point across the full range (typically 1,100–2,500 nm). Covering the full range gives access to the strongest protein and oil bands above 2,000 nm. Blue Sun's Phoenix analyzers use this design.
Diode array. A fixed grating spreads the light across a row of detectors, so all wavelengths are captured at the same instant. With no moving parts it is very fast, which suits on-line and moving-sample measurements; many diode-array instruments cover a shorter range (often about 950–1,650 nm).
FT-NIR (Fourier transform). An interferometer with a moving mirror records all wavelengths together as an interferogram, which is converted to a spectrum mathematically. FT-NIR is common in pharmaceutical and chemical labs where very high wavelength precision is needed.
Reading an NIR spectrum
Plotting how much light the sample absorbed at each wavelength gives its NIR spectrum — a chemical fingerprint. Peaks appear where bonds absorbed light: water, oil and protein each leave their own marks, and the size of each peak depends on how much of that component is present.

An NIR spectrum of a ground sample, with the main water, fat and protein peaks labeled. Absorbance is calculated from reflectance (R) as log(1/R).
The catch is that these peaks are broad and overlap each other. No single peak gives an exact protein or moisture value on its own. That is why every NIR analyzer needs a calibration — covered below.
How an NIR calibration is built
A calibration is the model that turns a spectrum into numbers. It is built by teaching the analyzer what known samples look like:

How an NIR calibration is built.
Scan samples and measure lab values. Collect samples that cover the full range you expect to see — different suppliers, seasons, moisture levels — scan them, and send them for reference (wet chemistry) analysis.
Remove scatter effects. Particle size and packing change the spectrum without changing the chemistry. Math pretreatments such as derivatives and scatter correction remove most of that noise.
Find the main patterns. Partial least squares (PLS) regression finds the patterns in the spectra that track the lab values.
Choose the model size. Cross-validation picks how many patterns (PLS factors) to keep — enough to be accurate, not so many that the model memorizes noise.
Build the model. The result is a set of regression coefficients across the wavelengths.
Test it on new samples. The model is validated on samples it has never seen. The key statistic is the SEP (standard error of prediction) — how close NIR results are to the lab.
Predict routine samples. From then on, each new scan returns results in seconds.

Once calibrated, the analyzer converts each new spectrum into results such as moisture in seconds.
How many samples does a calibration need? As a starting rule, Blue Sun's applications team recommends 40–50 samples per component. For a typical food product on a scanning instrument, about 100 samples is a good target, collected over time so they include normal product and process variation. Natural products that vary a lot, such as forages, can need 500 to 1,000 samples or more, which is why many forage labs license calibrations from specialist providers rather than building their own. Whatever the product, an analyzer only predicts accurately for samples like the ones in its calibration.
Cover the full range. The calibration samples must span every value you expect to see in routine use. A calibration built only on samples between 10% and 14% moisture, for example, can't be trusted at 18%. An even spread across the range works best; a set made only of very high and very low samples is not recommended.
Validate, then keep checking. Before a calibration goes into routine use, test it on 5–10 samples that weren't used to build it, comparing NIR with the lab. After that, recheck whenever something changes:
The samples: new suppliers, growing seasons, crop years or process changes.
The reference lab: a different lab, method, chemicals or technician.
The instrument: new sample cups, a different environment, or repairs.
A small bias adjustment, or adding a few new samples and recalibrating, usually brings the results back in line.
Tips for getting accurate results
Most problems with NIR results trace back to the samples or the reference data rather than the instrument. A few habits make a big difference, especially when building or checking a calibration:
Ask the lab for duplicate analyses. Running every sample twice shows how repeatable the lab is for each component, which tells you how close NIR can realistically get.
Use the same sample for both. Send the lab a portion from the same container you scanned, not a separate grab sample.
Label everything identically. Give the NIR scan and the lab sample the same ID. Without that, matching NIR and lab results later is guesswork.
Prepare samples the same way. If you grind samples before scanning, tell the lab, so both measurements are made on comparable material.
Seal and date samples in transit. Moisture can change between scanning and lab analysis, so seal containers and send them promptly.
Check your replicate scans. Scan each sample more than once and look for scans that don't match. Repeat any you're unsure of.
NIR vs. wet chemistry
NIR doesn't replace reference methods — calibrations are built from them — but it changes how often you can test.
NIR analysis | Wet chemistry | |
Time per sample | About 30 seconds | Hours to days (often sent to an outside lab) |
Chemicals | None | Solvents, acids, reagents |
Sample | Not destroyed | Consumed |
Parameters | Several from one scan | Usually one test per parameter |
Cost per test | Very low after purchase | Lab fee or reagent and labor cost per test |
Accuracy | Typically 1–1.5× the reference method's error when well calibrated | The reference standard |
For a fuller comparison, read our guide: Choosing Between NIR and Wet Chemistry: A Lab Manager's Guide.
What is NIR used for?
Because one scan can measure several components in seconds, NIR is used wherever composition drives cost, quality or compliance:
Forage and hay — dry matter, protein, ADF, NDF and digestibility for ration balancing. Forage NIR analyzer
Animal feed — checking incoming ingredients and finished feed for protein, fat, fiber, starch and moisture. NIR feed analyzer
Oilseeds — oil, protein and moisture in soybeans, canola and their meals. Soybean · Canola
Pet food — moisture, protein, fat, fiber and ash in ingredients and kibble. Pet food analyzer
Rendering — moisture, protein and fat in meat and bone meal, poultry meal and other rendered products. Rendering analyzer
Snack foods — oil, moisture and seasoning in chips and snacks. Snack food analyzer
Dairy — moisture, fat and protein in milk powders, cheese and butter. Dairy analyzer
Flour and grain — protein, moisture and ash for millers and bakers. Flour analyzer
When NIR is not the right tool
NIR is versatile, but it has limits worth knowing before you buy:
Very low concentrations. NIR works best for major components. Trace levels below 0.1% are usually better measured by other methods.
Individual minerals and contaminants. Calcium, phosphorus, mycotoxins and similar targets are predicted indirectly at best; reference methods remain the standard.
No calibration, no result. An analyzer is only as good as its calibration. A new product type needs reference data before NIR can measure it.
Frequently asked questions
What does NIR stand for?
NIR stands for near-infrared. NIR spectroscopy (also written NIRS) is the analysis of materials using near-infrared light.
What is an NIR analyzer?
An NIR analyzer is an instrument that measures the composition of a sample — such as moisture, protein, fat or fiber — by shining near-infrared light on it and analyzing the light that comes back.
How accurate is NIR analysis?
NIR is calibrated against a reference lab method, so it can never be more accurate than that method. In practice, a well-built calibration gives an error of about 1 to 1.5 times the error of the reference method itself, expressed as the SEP (standard error of prediction) for each parameter. NIR is often more precise than the lab, though: repeat scans of the same sample agree very closely. You can measure your lab's own precision by sending about 10 samples as blind duplicates.
How long does NIR analysis take?
Most benchtop NIR analyses take about 30 seconds per sample, compared with hours or days for wet chemistry.
Does NIR destroy the sample?
No. NIR only shines light on the sample, so it can be re-tested or sent to a lab for confirmation.
What is the difference between NIR and IR (mid-infrared)?
Both use infrared light, but mid-infrared (MIR/FTIR) uses longer wavelengths where absorption is much stronger, so samples usually must be very thin or diluted. NIR's weaker absorption lets light penetrate thick, unprepared samples like ground grain or kibble, which is why NIR is preferred for routine food and agricultural analysis.
Can NIR measure wet or unground samples?
Yes, with the right sample cup and calibration. Many analyzers can measure fresh forage, wet pastes or whole grain, though grinding usually improves precision.
Can I use calibrations from another NIR instrument?
Often, yes. Calibrations can be transferred between instruments using spectral matching and standardization, which lets labs keep years of calibration work when they change platforms.
At Blue Sun Scientific, our NIR specialists bring decades of combined experience to labs and plants in food, feed and agriculture. If you're wondering what NIR could do for your operation, we'd be glad to talk it through.
Have a question about NIR for your application? Talk to an NIR specialist


