Cell navigation is directed by inhomogeneous distributions of extracellular cues. It is well known that noise plays a key role in biology and is present in naturally occurring gradients at the micro- and nanoscale, yet it has not been studied with gradients in vitro. Here, we introduce novel algorithms to produce ordered and random gradients of discrete nanodots called digital nanodot gradients (DNGs) according to monotonic and non-monotonic density functions. The algorithms generate continuous DNGs, with dot spacing changing in two dimensions along the gradient direction according to arbitrary mathematical functions, with densities ranging from 0.02% to 44.44%. The random gradient algorithm compensates for random nanodot overlap, and the randomness and spatial homogeneity of the DNGs were confirmed with Ripleys K function. An array of 100 DNGs, each 400 × 400 µm2, comprising a total of 57 million 200 × 200 nm2 dots was designed and patterned into silicon using electron-beam lithography, then patterned as fluorescently labeled IgGs on glass using lift-off nanocontact printing. DNGs will facilitate the study of the effects of noise and randomness at the micro- and nanoscales on cell migration and growth.