How to Calculate NDVI in QGIS With the Raster Calculator: A Step-by-Step Guide
- Primary Signal: How to Calculate NDVI in QGIS With the Raster Calculator: A Step-by-Step Guide
- Overview: NDVI needs just two Sentinel-2 bands and one formula — here's how to run it in QGIS's raster calculator without any plugins....
- Verification: Analyzed and compiled by FreeSky GeoData editorial monitoring desk.
NDVI, the Normalised Difference Vegetation Index, is the most widely used satellite measure of plant health, and computing it in QGIS takes only a few minutes once you understand the formula. Healthy vegetation reflects strongly in near-infrared light and absorbs red light for photosynthesis, so the difference between those two bands reveals how vigorous the plants are. NDVI compresses that difference into a single number between minus one and plus one, where high values mean dense, healthy vegetation and low or negative values mean bare soil, water, or rock.
Start with a Sentinel-2 scene for your area, and identify the red band, Band 4 at ten-metre resolution, and the near-infrared band, Band 8, also at ten metres. Load both into QGIS and check that they align: they should share the same coordinate system and cover the same extent, and if one appears shifted, reproject it to match the other before calculating. Clip both bands to your study area first if the scene is large, because the raster calculator will process every pixel you give it, and a full Sentinel-2 tile is far bigger than most projects need.
Clouds are the main trap at this stage. A cloud pixel has high values in both bands and produces a misleading NDVI, so mask clouds before calculating or, better, choose a scene with low cloud cover over your area in the first place. The Copernicus browser shows a cloud percentage for each scene, and picking a clearer date is almost always easier than cleaning a cloudy one afterwards. Check the acquisition date too, since NDVI changes through the growing season and a comparison across dates needs scenes from comparable growth stages.
Open the Raster Calculator from the Raster menu and enter the formula: near-infrared minus red, divided by near-infrared plus red, using your two band layers as inputs. In practice that looks like (Band 8 minus Band 4) divided by (Band 8 plus Band 4), with the layer names filled in by double-clicking them in the calculator's layer list. Set the output extent and resolution to match your inputs, choose a GeoTIFF output, and run it; the result is a new raster where each pixel holds an NDVI value for that spot on the ground.
Style the result to read it: a simple red-to-green ramp, or a classified style with breaks around zero, makes vegetation patterns jump out immediately. Values near 0.8 indicate dense, healthy canopy, values around 0.3 to 0.5 suggest moderate vegetation or crops, and values near zero or below point to bare soil, rock, or water. Do not over-interpret a single NDVI map: the same value can mean different things for different crops and seasons, so compare it with ground knowledge or with imagery from the same field at other dates before drawing conclusions.
Validate the output by visiting, or at least inspecting, places you know: a forest should read high, a ploughed field low, a lake negative, and a road near zero. If the whole map looks wrong, the usual culprits are swapped bands, a mismatched projection, or an unmasked cloud, and each is quick to fix once spotted. Zoom into field boundaries to check for edge effects, where mixed pixels along borders produce intermediate values that belong to neither field nor road, and be cautious about conclusions drawn from those border pixels.
Save the raster calculator expression and the workflow notes with your project, because NDVI is rarely computed once: comparing dates, seasons, or fields is where it becomes genuinely useful. Export a styled map as an image for reports, but keep the raw NDVI raster as well, since a picture cannot be re-analysed while the numbers can. With that discipline, a simple two-band formula becomes a repeatable monitoring tool, and the next step, tracking change over a season, is just the same calculation repeated on new scenes.
📖 Continue Reading the Full Story
Continue reading this article on FreeSky GeoData.
⚡ Access Full Content Now