Control and transport of nanoscale objects in fluids is challenging because of the unfavorable scaling of most interaction mechanisms to small length scales. We designed energy landscapes for nanoparticles by accurately shaping the geometry of a nanofluidic slit and exploiting the electrostatic interaction between like-charged particles and walls. Directed transport was performed by combining asymmetric potentials with an oscillating electric field to achieve a rocking Brownian motor. Using gold spheres 60 nanometers in diameter, we investigated the physics of the motor with high spatiotemporal resolution, enabling a parameter-free comparison with theory. We fabricated a sorting device that separates 60- and 100-nanometer particles in opposing directions within seconds. Modeling suggests that the device separates particles with a radial difference of 1 nanometer.