A major challenge for achieving energy transition and transforming the current energy model into distributed production is the development of efficient artificial leaf-type devices capable of directly converting carbon dioxide (CO2), water and sunlight into sustainable fuels and chemicals under ambient conditions. These devices should avoid using critical raw materials to be sustainable and cost-competitive. We report top-level results for the first time in converting CO2 and H2O to fuels (formate and H2) using sunlight and electrodes based solely on earth-abundant materials. The cell provides a solar-to-fuel efficiency of >10% combined with world-record current densities to comparable devices operating at room temperature, without adding sacrificial donors or electrical bias. In addition, we present the novel concept of producing at the same time H2 and an H2-storage element (formate), the latter used to produce H2 when light is absent. This solution allows continuous (24 h) hydrogen production using an artificial-leaf device. For the first time, we show the feasibility of this solution. The experimental results were obtained in an optimised, compact electrochemical flow cell, with electrodes based on Cu–S and Ni–Fe–Zn oxide (for CO2 reduction and oxygen evolution reactions, respectively) supported on gas-diffusion substrates, integrated with a low-cost Si-based photovoltaic module. The cell design allows for easy scale-up and low manufacturing and operating costs. The cell operates at a current density of about 17 mA cm−2 and a full-cell voltage of 2.5 V (stable for at least ten hours and in on–off operations), providing formate productivity of 193 μmol h−1 cm−2, paving the way towards the implementation of affordable artificial-leaf type systems in the future energy scenario.