Home / Science / Earth sciences / Geomorphology / Watershed delineationTool #889

Watershed delineation from a DEM: fill sinks, D8 flow, flow accumulation, streams and catchment outline in the browser

Open a small DEM (GeoTIFF or ASCII grid, up to 1000 × 1000 cells), tap a stream to place the outlet, and see the area that drains to it: catchment area, perimeter, longest flow path, relief, mean slope, stream length, drainage density and Strahler order. Depressions are filled with Priority-Flood and flow follows D8. Download the outline and streams as GeoJSON, and flow accumulation and direction as GeoTIFF. Files never leave your device.

Keep it one tap away for everyday use.

Bookmark Watershed delineation?

Press Ctrl + D now. Your browser opens its own bookmark box, where you choose the name and folder.

  1. Open DEM
  2. Tap outlet
  3. Watershed
  4. GeoJSON
Nothing is uploadedWorks offline once open

Elevation grid (DEM)

A GeoTIFF (first band) or ESRI ASCII grid of up to 1 million cells (for example 1000 × 1000), so the work stays quick in a browser. Crop a larger DEM to the area around your stream first. Your file stays on this device: it is read in your browser and never uploaded.

What it does

A watershed (catchment, drainage basin) is all the land that drains to one point on a stream, its outlet or pour point. This tool finds it from a digital elevation model, step by step, the way GIS hydrology tools do:

  1. Fill depressions. Small pits in a DEM are usually errors, and water would get stuck in them. The tool fills them with the Priority-Flood method, raising each filled cell a tiny amount (far below a millimetre) above the cell it drains to, so flat areas drain too.
  2. Flow directions (D8). Each cell sends its water to whichever of its 8 neighbours is steepest downhill, measured as drop per metre of distance (diagonals are longer).
  3. Flow accumulation. For every cell, the number of cells whose water passes through it.
  4. Streams. Cells with more than a threshold number of cells draining through them form the stream network, each segment with its Strahler order (two order-1 streams make an order-2 stream, and so on).
  5. Watershed. Tap the map: the outlet moves to the cell with the most flow nearby (snapping, so a tap just beside the stream still lands on it), and every cell that drains to it is shaded and outlined.

How to use it

  1. Press Open a DEM and choose a GeoTIFF or ESRI ASCII grid of up to 1 million cells. Crop larger DEMs in a GIS first.
  2. Check the Cell size unit (degrees for SRTM-style grids; the tool then works out each row’s cell size in metres).
  3. Set the stream threshold: fewer cells show more, smaller streams.
  4. Tap a stream on the map. Read the watershed’s numbers, then download the outline and streams as GeoJSON for your GIS, or the flow accumulation and flow direction grids as GeoTIFF.

Worked example

Press Use the example to load a made-up valley of 240 × 200 cells of 10 m. The stream threshold starts at 192 cells (1.92 ha), which gives a network up to Strahler order 4. The example outlet is placed where you would tap at row 80, column 66 on the main stream; it snaps to row 84, column 64, where 19,377 cells drain in, a watershed of 1.938 km². Its outline is 6.64 km long, the longest flow path is 2.399 km, heights run from 239.4 to 698.4 m, and the mean slope is 12.8°. Filling raised 6 cells, by at most 0.2 m.

Limits and choices

  • Size: up to 1,000,000 cells, so every step stays quick on a phone.
  • Edges and gaps: cells on the edge of the grid, or next to cells without data, can drain out of the grid (no-data is treated like the sea or the edge). If your watershed touches the edge, part of it may be missing: use a larger DEM.
  • D8 sends all water one way, so on broad, gentle slopes streams run in straight lines at 45° steps. It is the standard method for delineating watersheds and gives the same catchments as other tools.
  • Flats drain through the tiny epsilon gradient left by filling, toward where they were reached from the outlet. Other tools resolve flats in other ways, so on large flat areas stream lines can differ a little between tools.

Accuracy

Checked on three synthetic DEMs (with pits, rounded flats and a no-data hole) against an independent Python Priority-Flood and numpy D8: filled heights, flow directions on every cell, flow accumulation and catchments were identical. Against pysheds 0.4: its fill_depressions gave the same filled DEM where no-data was not involved, and on our filled DEM its D8 directions, flow accumulation and Strahler orders matched on every interior cell (pysheds treats the grid edge differently).

FAQ

Why did my outlet jump? Snapping moves it to the cell with the largest flow within the snap distance. Set the snap distance to 0 to use exactly the cell you tap.

Is the area exact? It is the sum of the cells in the watershed, so it depends on the DEM’s cell size and quality, not on the drawing.

Where the numbers come from

  • Depression filling: R. Barnes, C. Lehman and D. Mulla, 'Priority-Flood: an optimal depression-filling and watershed-labeling algorithm for digital elevation models', Computers and Geosciences 62 (2014), the +epsilon variant; written by fibub.
  • Flow directions: the D8 method of J. F. O'Callaghan and D. M. Mark, 'The extraction of drainage networks from digital elevation data', Computer Vision, Graphics and Image Processing 28 (1984); direction codes as used by ESRI and pysheds.
  • Stream order: A. N. Strahler, 'Quantitative analysis of watershed geomorphology', Transactions of the American Geophysical Union 38 (1957).
  • Slope (for the mean slope): Horn's method, shared with the DEM terrain tool; WGS 84 constants for degree grids.
  • The example valley is made up by fibub.

Standard scientific values, such as constants, atomic weights and melting points, are facts found in every textbook; we name where ours were checked. If you are an author or publisher and want a value, a credit or a table changed or removed, tell us and we will act quickly.

Last updated 2026-11-09.

Related tools

Rainfall runoff calculator #141 Estimate the peak flow from a small catchment with the rational method (Q = CiA, Kirpich time of concentration, your own rainfall intensity curve) and the runoff depth, volume and triangular hydrograph from the SCS (NRCS) curve number method, with dry, average and wet ground. Area-weighted C and CN for mixed land use. SI or US units. Unit hydrograph builder #149 Build a unit hydrograph for a catchment from its area and time of concentration (a gamma curve with a peak rate factor, as in the SCS method, or a Nash cascade). Turn a series of excess rain into a storm hydrograph by convolution. Or derive the unit hydrograph from a storm you measured, with baseflow separation, a φ-index loss and a non-negative least-squares fit. DEM slope, aspect and hillshade #888 Open a digital elevation model (GeoTIFF or ESRI ASCII grid) and get slope (Horn's method), aspect, hillshade with your own sun position, and general, profile and plan curvature, as coloured maps with statistics, slope classes and an aspect breakdown. Degree grids such as SRTM are handled with the cell size worked out for each latitude. Download PNG, GeoTIFF or ASCII grid. Files never leave your device. Vector map viewer #893 Open a zipped shapefile, GeoJSON, KML or KMZ, or a CSV with WKT, and see it on a map you can pan and zoom. Read the attribute table, get each feature's area, perimeter and length on the WGS 84 ellipsoid, and save the layer as GeoJSON, KML or CSV with WKT. Projected shapefiles (UTM, Lambert, Albers, Web Mercator) are converted to latitude and longitude. Files never leave your device. Stream long profile and chi analysis #890 Trace a channel down a DEM (GeoTIFF or ASCII grid) by steepest descent, or paste a long profile, and get the long profile, a slope-area fit (ks and θ), a chi plot with the best concavity, normalised steepness ksn and knickpoint hints. Infinite slope factor of safety #891 Work out the infinite slope factor of safety for a shallow landslide, dry, partly saturated or saturated with seepage parallel to the slope, with cohesion and root cohesion. Get the critical slope angle, water table and depth, and see FS plotted against slope and water. For study, not a slope stability assessment.