The response of a microscopic dielectric object to an applied light field can profoundly affect its kinetic motion. A classic example of this is an optical trap, which can hold a particle in a tightly focused light beam. Optical fields can also be used to arrange, guide or deflect particles in appropriate light-field geometries. Here we demonstrate an optical sorter for microscopic particles that exploits the interaction of particles-biological or otherwise-with an extended, interlinked, dynamically reconfigurable, three-dimensional optical lattice. The strength of this interaction with the lattice sites depends on the optical polarizability of the particles, giving tunable selection criteria. We demonstrate both sorting by size (of protein microcapsule drug delivery agents) and sorting by refractive index (of other colloidal particle streams). The sorting efficiency of this method approaches 100%, with values of 96% or more observed even for concentrated solutions with throughputs exceeding those reported for fluorescence-activated cell sorting. This powerful, non-invasive technique is suited to sorting and fractionation within integrated ('lab-on-a-chip') microfluidic systems, and can be applied in colloidal, molecular and biological research.