A mass or mass to charge ratio selective ion trap is disclosed which directs ions into a small ejection region. A RF voltage acts to confine ions in a first (y) direction within the ion trap. A DC or RF voltage acts to confine ions in a second (x) direction. A quadratic DC potential well acts to confine ions in a third (z) direction within the ion trap. The profile of the quadratic DC potential well progressively varies along the second (x) direction.