The climate of early Mars could have supported a complex hydrological system and possibly a northern hemispheric ocean covering up to one-third of the planet's surface. This notion has been repeatedly proposed and challenged over the past two decades, and remains one of the largest uncertainties in Mars research. Here, we used global databases of known deltaic deposits, valley networks and present-day martian topography to test for the occurrence of an ocean on early Mars. The distribution of ancient martian deltas delineates a planet-wide equipotential surface within and along the margins of the northern lowlands. We suggest that the level reconstructed from the analysis of the deltaic deposits may represent the contact of a vast ocean covering the northern hemisphere of Mars around 3.5 billion years ago. This boundary is broadly consistent with palaeoshorelines suggested by previous geomorphologic, thermophysic and topographic analyses, and with the global distribution and age of ancient valley networks. Our findings lend credence to the hypothesis that an ocean formed on early Mars as part of a global and active hydrosphere.