NDVI Calculator
Calculate vegetation index from multispectral imagery
What Is NDVI?
NDVI β the Normalized Difference Vegetation Index β is the most widely used vegetation index in remote sensing. It is a simple ratio of two spectral bands that exploits the way healthy plants reflect light. Chlorophyll absorbs strongly in the red part of the visible spectrum (around 0.65 micrometres) and reflects strongly in the near-infrared (around 0.85 micrometres). The bigger the contrast between red and NIR for a pixel, the more vigorous the vegetation. NDVI normalises that contrast onto a fixed -1 to +1 scale.
The NDVI Calculator on gis.tools loads two GeoTIFF bands β one red, one NIR β and computes the NDVI raster in the browser using the standard formula NDVI = (NIR - Red) / (NIR + Red). The output is a Float32 GeoTIFF you can preview, probe and export. People search for "ndvi calculator", "calculate ndvi online", "ndvi from satellite", "sentinel-2 ndvi", "landsat ndvi" and "ndvi formula" because NDVI is the universal first-pass vegetation indicator for agriculture, forestry, drought monitoring, climate science and ecology.
NDVI was introduced by Rouse, Haas, Schell and Deering in 1973-74 using ERTS-1 (later renamed Landsat-1) data. Five decades later it remains a baseline metric in nearly every Earth observation satellite mission, from Landsat 8/9 to Sentinel-2 to MODIS to Planet's daily SuperDoves.
How NDVI Works
The math behind NDVI is intentionally simple. For each pixel:
NDVI = (NIR - Red) / (NIR + Red)
The denominator normalises the result onto -1 to +1 regardless of overall brightness, which means a shaded patch of forest still produces a similar NDVI to a sunlit patch β the brightness cancels out, only the spectral contrast matters.
Why Red and NIR
Healthy chlorophyll-rich leaves absorb 80-90% of incoming red light (for photosynthesis) and reflect 40-50% of incoming near-infrared light (because NIR has too little energy to drive photosynthesis and the leaf cell wall structure scatters it). Bare soil reflects red and NIR roughly equally; water absorbs both but absorbs NIR more strongly than red. The ratio collapses these very different spectral signatures into a single interpretable number.
Value Interpretation
- NDVI close to 1.0: dense, healthy vegetation (closed-canopy forest, peak-season corn)
- NDVI 0.5 to 0.7: moderate vegetation (shrubs, sparse forest, mid-season crops)
- NDVI 0.2 to 0.5: light vegetation, grasslands
- NDVI 0.0 to 0.2: bare soil, urban
- NDVI < 0: water, snow, clouds, shadow
Band Numbers Per Satellite
The exact band numbers vary by sensor:
- Landsat 4-5 TM and Landsat 7 ETM+: Red = Band 3, NIR = Band 4
- Landsat 8-9 OLI: Red = Band 4, NIR = Band 5
- Sentinel-2 MSI: Red = Band 4 (B04), NIR = Band 8 (B08, 10 m) or Band 8A (B8A, 20 m, narrow NIR)
- MODIS: Red = Band 1, NIR = Band 2
Surface Reflectance vs Top of Atmosphere
NDVI computed from top-of-atmosphere (TOA) reflectance is faster to obtain but distorted by atmospheric scattering. Surface reflectance (SR) products are atmospherically corrected and produce more accurate, time-comparable NDVI. The Sentinel-2 Level-2A and Landsat Collection 2 Level-2 products are SR.
Key Parameters and Options
Input Bands
Provide one red band raster and one NIR band raster as separate GeoTIFFs. Both must cover the same area, share the same CRS, the same cell size and the same pixel grid. If they do not, reproject and resample with the Raster Resampler first.
Output Range
The standard output is Float32 in the range -1 to +1. Some workflows scale this to 0-255 (Byte) or 0-10000 (Int16) for storage efficiency.
Nodata Handling
Cells where either input band is nodata produce nodata in the output. Cells where the denominator is zero (both bands equal zero) are also flagged nodata.
Cloud and Shadow Masking
For best results, mask out clouds, cloud shadows, snow and water before computing NDVI. Sentinel-2 and Landsat ship a Scene Classification Layer (SCL) or QA band you can apply with the Raster Reclass Tool.
Practical Applications
Precision Agriculture
Farmers use weekly NDVI maps from Sentinel-2 or Planet to spot underperforming zones in their fields. A patch with lower NDVI than the rest of the crop suggests irrigation failure, pest damage, nitrogen deficit or compaction. Variable-rate fertiliser applications are guided by NDVI prescription maps.
Drought Monitoring
National drought indicators (US Drought Monitor, EDO in Europe) ingest multi-year NDVI anomaly time series to identify regions where current vegetation vigour is below the historical norm. NDVI complements rainfall and soil moisture data for early-warning systems.
Phenology Studies
Plant phenologists track the seasonal start, peak and end of greening using NDVI time series. Long-term records reveal how climate change is shifting bud break, leaf-out and senescence dates.
Wildfire Burn Severity
Although the differenced Normalised Burn Ratio (dNBR) is the standard, NDVI before vs after a fire is a quick first look at burn severity. Reductions of 0.4 or more typically indicate stand-replacing fire.
Forest Health and Defoliation
Insect outbreaks, disease and ice storm damage all reduce canopy NDVI before any structural change is visible. Time-series NDVI helps foresters detect outbreaks early.
Urban Green Space and Heat Island Mitigation
Urban planners use NDVI to map tree canopy distribution, identify heat-island hotspots with little vegetation and target tree planting programs.
Conservation and Habitat Quality
Conservation scientists use NDVI as a proxy for primary productivity in habitat suitability models for grassland birds, large herbivores and pollinators.
Step-by-Step Workflow in gis.tools
- Open the NDVI Calculator page on gis.tools.
- Drag the red band GeoTIFF into the "Red" slot. The file is decoded locally with
geotiff.js. - Drag the NIR band GeoTIFF into the "NIR" slot. The tool checks that the CRS, extent and cell size match.
- If the bands are misaligned, the tool warns you and offers to resample. Otherwise click Calculate.
- The pixel-by-pixel NDVI computation runs in WebAssembly. A 4000x4000 scene takes about a second.
- Preview the result with a green-to-red diverging colour ramp.
- Use the Raster Value Probe to confirm pixel-level values at known points.
- Export the NDVI raster as Float32 GeoTIFF (lossless) or Int16 scaled to -10000 to +10000 (compact).
- Pass it into the Raster Reclass Tool to bin into vegetation classes, or into Zonal Statistics to summarise NDVI per agricultural field.
Worked Example: Sentinel-2 NDVI Over an Iowa Cornfield
You download a Sentinel-2 Level-2A scene over central Iowa from late July, when corn is at peak greenness. You extract the B04 (red) and B08 (NIR) bands as separate GeoTIFFs and drop them into the NDVI Calculator. The tool confirms both bands are 10 m, EPSG:32615 (UTM 15N), and aligned. After Calculate runs, the NDVI raster shows the field interiors clustering around 0.85 β peak vigour β with lower values along the headlands and inside a 5-acre patch where the centre pivot irrigator failed earlier in the week. You probe the patch to confirm NDVI of 0.55, distinctly lower than the 0.85 surrounding the lesion, and you flag the area for follow-up. You export the raster, then run Zonal Statistics using the field boundary polygons to compute per-field mean NDVI and identify the worst three fields by deviation from the historical mean.
Common Pitfalls and Gotchas
- Mixing bands from different dates produces meaningless NDVI β both inputs must be from the same scene.
- Forgetting to scale Sentinel-2 reflectance (which arrives as 0-10000 scaled integer) before applying the formula. The NDVI formula is dimensionless, so consistent scaling is fine, but mixing scaled and unscaled inputs is wrong.
- Failing to mask clouds and shadows: a cloud has high reflectance in both red and NIR, so its NDVI is near zero β this contaminates time-series statistics.
- Top-of-atmosphere vs surface reflectance: TOA NDVI is acceptable for a single date but not for cross-date comparisons.
- Saturation of NDVI in dense canopies (closed forest) β values cluster at the 0.85-0.95 ceiling and lose sensitivity. Use EVI or NIRv for dense canopies.
- Using Landsat band 4 from L8 instead of band 5: Landsat-7 NIR is band 4; Landsat-8 NIR is band 5. Confusing the two is a classic mistake.
- Bands at different resolutions (Sentinel-2 mixes 10 m and 20 m): always resample to a common grid before computing NDVI.
- Float division by zero where both inputs are zero β the tool flags these as nodata.
Tips for Best Results
- Use Surface Reflectance (Level-2 or atmospherically corrected) data, not Top of Atmosphere, for comparisons across dates.
- Mask clouds, shadows and snow with the SCL or QA band before NDVI computation.
- For Sentinel-2 use B04 and B08 at 10 m. For 20 m workflows use B04 (resampled to 20 m) and B8A.
- Average NDVI over an entire growing season β rather than a single date β to smooth out noise.
- Pair NDVI with the Soil Adjusted Vegetation Index (SAVI) or EVI in arid regions to reduce soil background effects.
- Use the Raster Reclass Tool to bin NDVI into discrete vegetation classes before reporting.
- Always validate against ground truth when available.
- Save the original red and NIR bands so you can recompute if you change masking thresholds.
Comparison with Other GIS Approaches
QGIS provides the Raster Calculator, GDAL has gdal_calc.py --calc='(A.astype(float) - B) / (A + B)', ArcGIS Spatial Analyst's Raster Calculator and the dedicated Band Arithmetic tool both compute NDVI in one click, and Google Earth Engine reduces the operation to image.normalizedDifference(['B8','B4']). The NDVI Calculator on gis.tools mirrors all of these in a no-install browser environment. The trade-off is that batch processing across hundreds of dates is better suited to Earth Engine or a Python pipeline, but for one-off interactive NDVI on a single scene the gis.tools workflow is the fastest path.
Performance Considerations
NDVI is per-pixel arithmetic β O(n) with very small constants. A Sentinel-2 tile (10980x10980, ~120 megapixels) at Float32 occupies ~480 MB in memory and takes a few seconds to compute. For larger scenes or weak machines, clip the inputs to your AOI with Clip Raster by Polygon before running NDVI.
Data Privacy and Browser-Based Processing
The red and NIR bands stay on your machine. The File API reads the bytes; geotiff.js decodes; a WebAssembly numerical kernel computes NDVI; a download blob writes the output. There is no upload, no server, no telemetry. This is essential for proprietary commercial satellite imagery (Planet, Maxar, BlackSky) and for academic researchers under licensing restrictions that forbid third-party uploads.
Related GIS Concepts
EVI (Enhanced Vegetation Index): A more sensitive index for high-biomass canopies that uses red, NIR and blue bands. Less prone to NDVI saturation.
SAVI (Soil Adjusted Vegetation Index): A modified NDVI that downweights soil background reflectance, useful in arid environments.
NIRv: NIR multiplied by NDVI; tracks gross primary productivity better than raw NDVI.
dNBR (differenced Normalised Burn Ratio): A NIR-SWIR ratio used for burn severity mapping rather than vegetation vigour.
TOA vs SR Reflectance: Top-of-atmosphere reflectance is the raw sensor measurement; surface reflectance is corrected for atmospheric absorption and scattering.
Frequently Asked Questions
Which bands do I use for Sentinel-2 NDVI?
B04 (red, 10 m) and B08 (NIR, 10 m). Use B8A (narrow NIR) at 20 m if you are working at that resolution.
What about Landsat 8?
Use Band 4 (red) and Band 5 (NIR). For Landsat 5 and 7 use Bands 3 and 4 β the band numbering shifted with Landsat 8.
Why does NDVI saturate over dense forests?
The red band reflectance asymptotes to almost zero at high biomass, so NDVI loses sensitivity above ~0.85. Use EVI or NIRv for closed canopies.
Can I compute NDVI from drone imagery?
Yes, if your sensor has red and NIR channels β for example MicaSense, Parrot Sequoia, MAPIR Survey. Calibrate first using the reflectance panels.
Does the calculator handle masked pixels?
Yes. Cells with nodata in either input become nodata in the output. Mask clouds/shadows in the bands before importing.
Can I export the NDVI as Byte to save space?
Yes β scale the -1..1 range to 0..255 first, but lossy quantisation may matter for time-series analysis.
Related Tools on gis.tools
Related Tools
View All ToolsGeoTIFF Viewer
View GeoTIFF bands with nodata handling and min/max stretch
Raster ToolsClip Raster by Polygon
Clip raster data to a polygon boundary
Raster ToolsRaster Mosaic Preview
Preview multiple raster tiles as a single view
Raster ToolsZonal Statistics
Calculate raster statistics within polygon zones
Raster ToolsRaster to Points
Sample raster values to a point grid
Raster ToolsRaster Reclass Tool
Reclassify raster values based on custom rules
Raster Tools100% client-side processing - your data stays private and never leaves your device