Although coherent large-scale structures such as filaments and walls are apparent to the eye in galaxy redshift surveys, they have so far proven difficult to characterize with computer algorithms. This paper presents a procedure that uses the eigenvalues and eigenvectors of the Hessian matrix of the galaxy density field to characterize the morphology of large-scale structure. By analysing the smoothed density field and its Hessian matrix, we can determine the types of structure – walls, filaments or clumps – that dominate the large-scale distribution of galaxies as a function of scale. We have run the algorithm on mock galaxy distributions in a Λcold dark matter cosmological N-body simulation and the observed galaxy distributions in the Sloan Digital Sky Survey. The morphology of structure is similar between the two catalogues, both being filament-dominated on 10–20 h−1 Mpc smoothing scales and clump-dominated on 5 h−1 Mpc scales. There is evidence for walls in both distributions, but walls are not the dominant structures on scales smaller than ∼ 25 h−1 Mpc. Analysis of the simulation suggests that, on a given comoving smoothing scale, structures evolve with time from walls to filaments to clumps, where those found on smaller smoothing scales are further in this progression at a given time.