Cyanobacteria have a wide range of impact on natural ecosystems, and have been recognized as potentially rich sources of pharmacological and structurally interesting secondary metabolites. To better understand the basic molecular processes and mechanisms that influence and regulate the growth (like length) of cyanobacteria, or connections between environment, genotype, and phenotype, it would be essential to separate shape-synchronized cyanobacterial cell populations with relatively uniform length and size. This work proposes a novel and efficient method to separate cyanobacterial Anabaena by shape (rod aspect ratio) using viscoelastic microfluidics in a straight channel with expansion-contraction cavity arrays (ECCA channel). The biocompatible viscoelastic solutions with dissolved polymer would induce a combined effect of inertial lift force, elastic force, and secondary drag force for Anabaena flowing in it. Therefore, Anabaena with different lengths reach different lateral equilibrium positions and flow out from different outlets. Factors including flow rate, fluid viscoelasticity, channel structure, and length on the shape-based cell separation were studied systematically. This work, for the first time, demonstrates continuous and sheathless shape-based separation of cyanobacteria using viscoelastic microfluidics. Moreover, its ability to manipulate objects with different morphologies and with a size of >100 μm will extend the capability of microfluidics to a completely new field that has never been reached and would be attractive across a range of new applications.