Charge transport in nanostructures and thin films is fundamental to many phenomena and processes in science and technology, ranging from quantum effects and electronic correlations in mesoscopic physics, to integrated charge- or spin-based electronic circuits, to photoactive layers in energy research. Direct visualization of the charge flow in such structures is challenging due to their nanometer size and the itinerant nature of currents. In this work, we demonstrate non-invasive magnetic imaging of current density in two-dimensional conductor networks including metallic nanowires and carbon nanotubes. Our sensor is the electronic spin of a diamond nitrogen-vacancy center attached to a scanning tip. Using a differential measurement technique, we detect DC currents down to a few uA above a baseline current density of 2e4 A/cm2. Reconstructed images have a spatial resolution of typically 50 nm, with a best-effort value of 22 nm. Current density imaging offers a new route for studying electronic transport and conductance variations in two-dimensional materials and devices, with many exciting applications in condensed matter physics.