We present a magnetic levitation technique coupled with automated imaging and analysis in both a smartphone-compatible device and a device with embedded imaging and processing. This is applied to measure the density distribution of cells with two demonstrated biomedical applications: sickle cell disease diagnosis and separating white and red blood cells.