We have developed a compact and inexpensive microfluidic chip, the self-assembled magnetic filter, to efficiently remove magnetically tagged cells from suspension. The self-assembled magnetic filter consists of a microfluidic channel built directly above a self-assembled NdFeB magnet. Micrometre-sized grains of NdFeB assemble to form alternating magnetic dipoles, creating a magnetic field with a very strong magnitude B (from the material) and field gradient ▽B (from the configuration) in the microfluidic channel. The magnetic force imparted on magnetic beads is measured to be comparable to state-of-the-art microfabricated magnets, allowing for efficient separations to be performed in a compact, simple device. The efficiency of the magnetic filter is characterized by sorting non-magnetic (polystyrene) beads from magnetic beads (iron oxide). The filter enriches the population of non-magnetic beads to magnetic beads by a factor of >10(5) with a recovery rate of 90% at 1 mL h(-1). The utility of the magnetic filter is demonstrated with a microfluidic device that sorts tumor cells from leukocytes using negative immunomagnetic selection, and concentrates the tumor cells on an integrated membrane filter for optical detection.