This paper analyzes the effect of school vouchers on student sorting - defined as a flight to private schools by high-income and committed public-school students - and whether vouchers can be designed to reduce or eliminate it. Much of the existing literature investigates sorting in cases where private schools can screen students. However, publicly funded U.S. voucher programs require a private school to accept all students unless it is oversubscribed and to pick students randomly if it is oversubscribed. This paper focuses on two crucial requirements of the Milwaukee voucher program: 1) private schools must select students randomly and 2) private schools must accept the voucher amount as full tuition payment (that is, 'topping up' of vouchers is not permitted). Using a theoretical model, this study argues that random selection alone cannot prevent student sorting. However, random selection together with the absence of topping up can preclude sorting by income, although there is still sorting by ability. Sorting by ability is not caused here by private-school selection, but rather by parental self-selection. Using a logit model and student-level data from the first five years of the Milwaukee voucher program, 1990-94, this study establishes that random selection has indeed taken place, providing an appropriate setting for testing the corresponding theoretical predictions in the data. Next, using several alternative logit specifications, it demonstrates that these predications are validated empirically. These findings appear to have important policy implications.