We prove that the maximum determinant of an $n \times n $ matrix, with entries in $\{0,1\}$ and at most $n+k$ non-zero entries, is at most $2^{k/3}$, which is best possible when $k$ is a multiple of 3. This result solves a conjecture of Bruhn and Rautenbach. We also obtain an upper bound on the number of perfect matchings in $C_4$-free bipartite graphs based on the number of edges, which, in the sparse case, improves on the classical Bregman's inequality for permanents. This bound is tight, as equality is achieved by the graph formed by vertex disjoint union of 6-vertex cycles.