The transfection of molecules into cultured cells is a critical step toward fundamental studies of cells, drug screening, and stem cell reprogramming/differentiation. Despite rapid development of transfection methods, efficient transfection of adherent cells while maintaining viability is still challenging, in particular, for sensitive primary cells. To achieve this goal, we present a microfluidic device containing a membrane with micro-or nanochannels, which allow transfection of adherent cells by localized electroporation through the channels. We used numerical simulations to explore the design parameter space of the microfluidic device to quantify the electric field applied near a target cell as a function of the channel dimensions. This analysis predicted that the microfluidic device applies a highly focused electric field to only the small area of a cell that is in contact with the membrane channel, which is a unique feature that minimizes stress to the cell. We transfected HeLa and HT1080 cells with DNA plasmid with efficiencies up to 50% while maintaining cell viability similar to control experiments without electroporation. Thus, this microfluidic device for on-chip cell culture and localized electroporation offers a gentle, yet effective transfection method and maintains high viability.