Comment

Remote sensing ยท Formula guide

NDWI Formula: Landsat 5, 8 and 9 Bands With Calculator

NDWI = (Green โˆ’ NIR) / (Green + NIR) for open water: Bands 3 and 5 on Landsat 8 and 9, Bands 2 and 4 on Landsat 5. The other NDWI, (NIR โˆ’ SWIR) / (NIR + SWIR), tracks water in leaves.

Authored by Farmonaut Research & Content Team
Reviewed and verified by Farmonaut Agricultural Experts Team
Updated 5 November 2026 ยท 10 min read
Sentinel-2 Satellite View Of Irrigated Farmland In The San Joaquin Valley, California
Sentinel-2 view of Irrigated farmland in the San Joaquin Valley, California. Contains modified Copernicus Sentinel data, processed in Google Earth Engine.

Key takeaways

  • Open-water NDWI (McFeeters, 1996): (B3 โˆ’ B5) / (B3 + B5) on Landsat 8-9, (B2 โˆ’ B4) / (B2 + B4) on Landsat 5.
  • Leaf-water NDWI (Gao, 1996), which USGS publishes as NDMI: (B5 โˆ’ B6) / (B5 + B6) on Landsat 8-9, (B4 โˆ’ B5) / (B4 + B5) on Landsat 5.
  • Convert Collection 2 pixels first: DN ร— 0.0000275 โˆ’ 0.2 (USGS). Skipping this turned a sample NDWI of โˆ’0.21 into โˆ’0.08.
  • The guides cited here set water cut-offs at 0.3 and 0.5, and built-up land often reads 0 to 0.2 (Sentinel Hub), so test on your own scene.
In this article
  1. NDWI formula by satellite: the band table
  2. Two indices share one name
  3. How Landsat 5, Landsat 8 and Landsat 9 differ
  4. How to calculate NDWI step by step
  5. What NDWI values mean
  6. Uses in farming, water and site work
  7. Limits to plan for
  8. NDWI, NDVI and other indices together
  9. FAQ

The NDWI formula is (Green โˆ’ NIR) / (Green + NIR), the version McFeeters proposed in 1996 to map open water. On Landsat 8 and 9 that means (Band 3 โˆ’ Band 5) / (Band 3 + Band 5). On Landsat 5 it means (Band 2 โˆ’ Band 4) / (Band 2 + Band 4).

A second index, published by Gao the same year, also carries the name NDWI. It uses (NIR โˆ’ SWIR) / (NIR + SWIR) and tracks water in leaves, not lakes. This guide gives the band numbers for each satellite, a pixel calculator that handles the Landsat scale factor, and worked examples.

NDWI formula by satellite: the band table

Band numbers changed between Landsat generations, so the same formula uses different files. The table follows the USGS Landsat band designations and the Copernicus Sentinel-2 mission page.

Satellite Green NIR SWIR 1 NDWI for open water NDWI for leaf water (NDMI)
Landsat 4-5 TM B2 B4 B5 (B2 โˆ’ B4) / (B2 + B4) (B4 โˆ’ B5) / (B4 + B5)
Landsat 7 ETM+ B2 B4 B5 (B2 โˆ’ B4) / (B2 + B4) (B4 โˆ’ B5) / (B4 + B5)
Landsat 8-9 OLI B3 B5 B6 (B3 โˆ’ B5) / (B3 + B5) (B5 โˆ’ B6) / (B5 + B6)
Sentinel-2 MSI B3 B8 B11 (B3 โˆ’ B8) / (B3 + B8) (B8 โˆ’ B11) / (B8 + B11)

A common slip is to reuse Landsat 8 numbers on a Landsat 5 scene. Band 3 on Landsat 5 is red and Band 5 is SWIR, so the result is not NDWI at all. Check the band table against your scene ID before you run anything. For crop water use, see our guide to NDWI, NDMI and evapotranspiration.

Two indices share one name

Much of the confusion around NDWI comes from two 1996 papers. Both chose the same name for different jobs. Sentinel Hub’s script library separates them for this reason: green and NIR for water bodies, NIR and SWIR for water in leaves.

McFeeters NDWI: open water

Water absorbs strongly in the near infrared, while it still reflects some green light. Green minus NIR therefore turns positive over water and negative over most plants. Use this version for ponds, reservoirs, flood extent and shoreline change.

Gao NDWI: water in plants

SWIR reflectance responds to the water held in a canopy. NIR responds to leaf structure and dry matter but not to water content. Combining the two removes much of the structural effect, which leaves a signal tied to canopy water. USGS publishes this ratio as NDMI, the Normalized Difference Moisture Index, and says it is used to determine vegetation water content. If your goal is irrigation or crop stress, this is the one to compute.

MNDWI: open water near buildings

Xu (2006) replaced NIR with SWIR to give MNDWI = (Green โˆ’ SWIR) / (Green + SWIR). The aim was better detection of open water. It matters because the green-NIR version is sensitive to built-up land and can overstate water, as Sentinel Hub notes. On Landsat 8 and 9 it reads (B3 โˆ’ B6) / (B3 + B6). On Landsat 5 it reads (B2 โˆ’ B5) / (B2 + B5).

How NDWI helps monitor farm water content from space

โ–ถ How NDWI helps monitor farm water content from space ยท 7:57

How Landsat 5, Landsat 8 and Landsat 9 differ

All three give 30 m pixels in these bands, so older and newer scenes can sit side by side. They are not identical, though.

Landsat 5

Landsat 8

  • Launched on 11 February 2013 with the OLI and TIRS sensors.
  • OLI records 12-bit data, which gives 4,096 possible grey levels per pixel at the sensor.
  • Nine spectral bands and two thermal bands, on a 16-day repeat cycle.

Landsat 9

  • Launched on 27 September 2021, flying 8 days out of step with Landsat 8.
  • Same band numbers as Landsat 8, so the NDWI formula for Landsat 9 is identical.

The OLI near-infrared band is much narrower than the TM one. It runs 0.85-0.88 ยตm against 0.76-0.90 ยตm. That means a long NDWI time series crossing from Landsat 5 to Landsat 8 may hold a small step that is a sensor change and not a change on the ground. Treat small shifts across that join with care.

Looking ahead, USGS expects Landsat 10 to launch in 2031 with 26 bands. The USGS table lists green as Band 4, broad NIR as Band 11 and SWIR 1 as Band 18, so scripts with fixed band numbers will need another update.

Chart

Where each NDWI band sits in the spectrum

Wavelength in nanometres, Landsat 4-5 TM vs Landsat 8-9 OLI

Band startBand end0 nm500 nm1,000 nm1,500 nm2,000 nmGreen: Landsat 5520 nm600 nmGreen: Landsat 8-9530 nm590 nmNIR: Landsat 5760 nm900 nmNIR: Landsat 8-9850 nm880 nmSWIR 1: Landsat 51,550 nm1,750 nmSWIR 1: Landsat 8-91,570 nm1,650 nmSource: USGS, Landsat band designations, accessed November 2026.
Band startBand end0 nm500 nm1,000 nm1,500 nm2,000 nmGreen: Landsat 5520 nm600 nmGreen: Landsat 8-9530 nm590 nmNIR: Landsat 5760 nm900 nmNIR: Landsat 8-9850 nm880 nmSWIR 1: Landsat 51,550 nm1,750 nmSWIR 1: Landsat 8-91,570 nm1,650 nmSource: USGS, Landsat band designations, accessed November2026.
OLI keeps the same regions as TM, but its near-infrared band is much tighter.

How to calculate NDWI step by step

  1. Choose the index. Open water: green and NIR. Crop or forest moisture: NIR and SWIR.
  2. Get surface reflectance. Download Landsat Collection 2 Level-2 products, which are already atmospherically corrected, so you do not need to correct them yourself.
  3. Convert the pixel values. Apply the scale factor below before you do any ratio.
  4. Mask clouds and shadow. Use the quality band that ships with the scene.
  5. Apply the formula. Use the bands from the table for your sensor.
  6. Set a threshold from your own scene. Compare results against places you know are water and not water.
  7. Map and compare. Use the same index, sensor family and season when you compare dates.

The scale factor that changes your answer

Collection 2 pixels are stored as whole numbers, not reflectance. USGS gives the conversion as DN ร— 0.0000275 โˆ’ 0.2. Its own example turns a pixel value of 18,639 into a reflectance of 0.313.

The โˆ’0.2 offset is why you cannot run the ratio on raw values. Take a green value of 11,000 and a NIR value of 13,000. On raw numbers, NDWI is โˆ’2,000 / 24,000 = โˆ’0.08. After conversion, green is 0.1025 and NIR is 0.1575, so NDWI is โˆ’0.055 / 0.26 = โˆ’0.21. That is a very different number from the same pixel.

NDWI needs no extra scaling step. A normalized difference of positive reflectances always falls between โˆ’1 and +1. A value outside that range points to a fill pixel or a negative reflectance after conversion. Raw values are all positive, so they stay inside the range, and a result inside the range does not prove you converted.

Code for Landsat 8 and 9

In a raster calculator or Python, with arrays read from the Collection 2 Level-2 files, the logic is short: green = B3 ร— 0.0000275 โˆ’ 0.2, then nir = B5 ร— 0.0000275 โˆ’ 0.2, then ndwi = (green โˆ’ nir) / (green + nir). For Landsat 5, read B2 and B4 instead. Treat pixels with a value of 0 as fill, since USGS uses 0 as the fill value for this product.

Try the numbers for your own farm below.

Calculator

What is the NDWI of your Landsat pixel?

Enter the raw Collection 2 Level-2 values for one pixel.

DN

DN

DN
-0.03NDWI for open water (green-NIR)
  • NDWI for leaf water / NDMI (NIR-SWIR): 0.05
  • MNDWI (green-SWIR): 0.03
  • NDWI on raw values, for comparison only: -0.01

Example values only, not a benchmark. Works for Landsat 4-9 Collection 2 surface reflectance. Fixed constants: scale factor 0.0000275 and offset โˆ’0.2 (USGS). Landsat 8-9 bands: green B3, NIR B5, SWIR B6. Landsat 4-5 bands: green B2, NIR B4, SWIR B5.

What NDWI values mean

No single cut-off works everywhere. Published guides differ, so use these as starting points only.

Green-NIR NDWI Usual reading Source
Above 0.5 Usually water bodies Sentinel Hub
0.3 and above Water, in a stricter variant meant to cut urban false alarms McFeeters (2013), via the NDWI reference summary
0 to 0.2 Often built-up areas, so check before calling it water Sentinel Hub
Below 0 Usually no open water: bright bare surfaces, and often plants NDWI reference summary

The middle range is where errors happen. Built-up land can read above 0, and shallow water or mixed pixels can read lower than clear open water, so low positive values need checking. A 30 m Landsat pixel covers 900 mยฒ, so a farm pond or a narrow canal often shares a pixel with its bank. The NDWI reference summary lists the original papers behind each threshold if you need to check them.

Leaf-water NDWI (NDMI) reads differently. It compares a canopy with itself over time. A falling value on one field through a dry spell says more than any fixed number, and a field visit should confirm the cause.

Uses in farming, water and site work

  • Irrigation checks. NIR-SWIR values over time can show uneven canopy moisture across a field, which supports farm water management and efficient water use.
  • Drought watch. The NDWI reference summary suggests the Gao version for vegetation in drought-affected areas.
  • Flood mapping. Green-NIR or green-SWIR versions outline flooded ground and changes in water level.
  • Farm ponds and reservoirs. Compare surface area between dates, within the limits of the pixel size.
  • Mine sites. Consultants can use the green-based versions to check tailings ponds, pit lakes and nearby water bodies across dated scenes.
  • Forest and pasture. The NIR-SWIR version is also applied to pasture management and to live fuel moisture for fire risk.
How satellite imagery is used in precision agriculture

โ–ถ How satellite imagery is used in precision agriculture ยท 13:41

Limits to plan for

Clouds. Clouds and their shadows distort the ratio, so mask them first. A global analysis in PMC put the mean at 141.4 daytime surface observations from Landsat 8 and Sentinel-2A/B combined in 2018, but only 81.9 after weighting for cloud.

Chart

How often a place can be imaged

Days between passes; last bar is a modelled global median, the others are design figures

0.0 d5.0 d10.0 d15.0 d20.0 d16.0 dOne Landsat10.0 dOne Sentinel-28.0 dLandsat 8 + 95.0 dSentinel-2 pair2.3 dAll fourSource: USGS Landsat 8 and 9 mission pages; Copernicus SentiWiki; revisit study in PMC using 2018 data, for the 2.3-day median;accessed November 2026.
0.0 d5.0 d10.0 d15.0 d20.0 dOne Landsat16.0 dOne Sentinel-210.0 dLandsat 8 + 98.0 dSentinel-2 pair5.0 dAll four2.3 dSource: USGS Landsat 8 and 9 mission pages; CopernicusSentiWiki; revisit study in PMC using 2018 data, for the2.3-day median; accessed November 2026.
Combining satellites shortens the wait, but clouds still remove views.

Revisit time. One Landsat satellite repeats every 16 days, so short events can fall between passes. Landsat 8 and 9 together give 8 days. Sentinel-2’s two-satellite setup gives 5 days at the equator, and the same PMC study reports a global median of 2.3 days with all four satellites modelled together.

Mixed land cover. Dense plants over shallow water can hide the water signal. Buildings can create a false one. MNDWI helps with the second problem.

Comparing sensors. Band widths differ, as the chart shows. Sentinel-2’s B8 is a wide band, and its B8A is the narrower one closer to Landsat 8’s NIR. Note which you used.

Chart

Band width of NIR and SWIR 1 by sensor

Nanometres; Sentinel-2A values

0 nm50 nm100 nm150 nm200 nmLandsat 5 SWIR 1200 nmLandsat 5 NIR140 nmSentinel-2A B8 NIR118 nmSentinel-2A B11 SWIR89 nmLandsat 8-9 SWIR 180 nmLandsat 8-9 NIR30 nmSource: USGS, Landsat band designations; Copernicus SentiWiki, S2 Mission band table, accessed November 2026.
0 nm50 nm100 nm150 nm200 nmLandsat 5 SWIR 1200 nmLandsat 5 NIR140 nmSentinel-2A B8 NIR118 nmSentinel-2A B11 SWIR89 nmLandsat 8-9 SWIR 180 nmLandsat 8-9 NIR30 nmSource: USGS, Landsat band designations; Copernicus SentiWiki,S2 Mission band table, accessed November 2026.
Wider bands average over more of the spectrum, so compare sensors with care.

NDWI, NDVI and other indices together

NDWI is easier to read alongside other indices. NDVI shows green plant cover, while NIR-SWIR moisture shows canopy water. A field with stable NDVI and falling moisture is a different case from one where both drop. Farmonaut’s satellite monitoring shows vegetation and moisture maps for a drawn field through the season. These maps show change, not its cause, so scout before you act. Readers building their own tools can compare this with other agricultural applications.

Tutorial: monitoring a farm with satellite crop indices in the Farmonaut web app

โ–ถ Tutorial: monitoring a farm with satellite crop indices in the Farmonaut web app ยท 8:43

FAQ

What is the NDWI formula?

For open water it is (Green โˆ’ NIR) / (Green + NIR), from McFeeters (1996). For water in plants it is (NIR โˆ’ SWIR) / (NIR + SWIR), from Gao (1996), now often called NDMI.

What is the NDWI formula for Landsat 8?

(B3 โˆ’ B5) / (B3 + B5) for open water. (B5 โˆ’ B6) / (B5 + B6) for leaf water. Convert to reflectance first when you use Collection 2 Level-2 data. Landsat 9 uses the same numbers.

What is the NDWI formula for Landsat 5?

(B2 โˆ’ B4) / (B2 + B4) for open water, and (B4 โˆ’ B5) / (B4 + B5) for leaf water.

What is a good NDWI value?

There is no universal good value. For open water, the guides cited here use 0.3 and 0.5. For crops, watch the trend on one field over time.

What is the difference between NDWI and MNDWI?

MNDWI swaps NIR for SWIR. Xu suggested it for better detection of open water, and it is often tried where built-up land confuses the green-NIR version.

Why are my NDWI values outside โˆ’1 to +1?

Likely causes are fill pixels or a negative reflectance after conversion. Raw values stay inside the range, so they are not the cause. Mask fill and cloud pixels, and keep values within the USGS valid range of 7,273 to 43,636.

Related pages on our site: satellite monitoring app, satellite data API, API documentation, agricultural monitoring, agricultural land, agricultural management, regenerative agriculture, farm sector cooperation.

Authored by: Farmonaut Research & Content Team

Reviewed and verified by: Farmonaut Agricultural Experts Team

Reviewed November 2026 against USGS Landsat band, scale-factor, NDMI and mission pages, the Copernicus SentiWiki Sentinel-2 mission page, Sentinel Hub’s NDWI and NDMI script notes, and a PMC revisit-interval study.

Farmonaut mineral detection

Map your mining site

Start at mining.farmonaut.com to map your site with satellite data.

Open The Farmonaut Crop Monitoring Web AppGet The Farmonaut App On Google PlayGet The Farmonaut App On The App Store
Farmonaut Web App With A Satellite Crop Health Map

Sources

  1. USGS, What are the band designations for the Landsat satellites?: usgs.gov
  2. USGS, How do I use a scale factor with Landsat Level-2 science products?: usgs.gov
  3. USGS, Landsat Normalized Difference Moisture Index: usgs.gov
  4. USGS, Landsat Collection 2 Level-2 Science Products: usgs.gov
  5. USGS, Landsat 5: usgs.gov
  6. USGS, Landsat 8: usgs.gov
  7. USGS, Landsat 9: usgs.gov
  8. USGS, Landsat 10: usgs.gov
  9. Copernicus SentiWiki, S2 Mission: sentiwiki.copernicus.eu
  10. Sentinel Hub custom scripts, NDWI: custom-scripts.sentinel-hub.com
  11. Sentinel Hub custom scripts, NDMI: custom-scripts.sentinel-hub.com
  12. Global Revisit Interval Analysis of Landsat-8/-9 and Sentinel-2A/-2B Data (PMC): ncbi.nlm.nih.gov
  13. Wikipedia, Normalized difference water index (reference list for Gao 1996, McFeeters 1996 and 2013, Xu 2006): en.wikipedia.org


Discussion

Questions, corrections or field experience? Share them below. First-time comments are reviewed before they appear, and your email is never published.

No comments yet. Be the first to add a question or your experience.

Leave a comment

Farmonaut Farmonaut Trusted by 200,000+ users and 100+ businesses 200,000+ users trust us Get started