We have developed a novel cell-sorting system involving microscopic imaging using a poly(methyl methacrylate) (PMMA)-based microfluidic chip with a pair of gel electrodes and real-time image-processing procedures for the quantification of cell shapes. The features of this system are as follows. 1) It can recognize cells both by microscopic cell imaging with a 10,000 event/s high-speed camera and by the photodetection of fluorescence. 2) Multistage sorting is used to reduce errors to an infinitesimally low level by using a pair of wide agarose-gel electrodes. 3) Carry-over-free analysis can be performed using a disposable microfluidic chip. 4) An field programmable gate array (FPGA) 10,000 event/s real-time image analysis unit for quantifying the cell images in cell sorting. To separate the target cells from other cells on the basis of the cell shape, we adopted an index of roughness for the cell surface R, which compares the actual perimeter of cell surface and the estimated perimeter of cross-sectional view of cell shape by approximating the cell as a sphere. Sample cells flowing through microchannels on the chip were distinguished by the dual recognition system involving optical analysis and a fluorescence detector, and then separated. Target cells could be sorted automatically by applying an electrophoretic force, and the sorting ability depended on the precision with which cells were shifted within the laminar flow. These results indicate that the cell-sorting system with on-chip imaging is practically applicable for biological research and clinical diagnostics.