Let s = ( s 1 , s 2 , … , s m ) and t = ( t 1 , t 2 , … , t n ) be vectors of non-negative integers with ∑ i = 1 m s i = ∑ j = 1 n t j . Let B ( s , t ) be the number of m × n matrices over { 0 , 1 } with jth row sum equal to s j for 1 ⩽ j ⩽ m and kth column sum equal to t k for 1 ⩽ k ⩽ n . Equivalently, B ( s , t ) is the number of bipartite graphs with m vertices in one part with degrees given by s , and n vertices in the other part with degrees given by t . Most research on the asymptotics of B ( s , t ) has focused on the sparse case, where the best result is that of Greenhill, McKay and Wang (2006). In the case of dense matrices, the only precise result is for the case of equal row sums and equal column sums (Canfield and McKay, 2005). This paper extends the analytic methods used by the latter paper to the case where the row and column sums can vary within certain limits. Interestingly, the result can be expressed by the same formula which holds in the sparse case.