The application of an electric field to demulsification of oil-in-water (O/W) emulsions has received extensive attention. However, microcosmic information about the effect of surfactant type on the demulsification of an O/W emulsion under an electric field is still rare. In this work, the effects of cationic surfactant cetyltrimethylammonium bromide (CTAB) and anionic surfactant sodium dodecyl sulfate (SDS) on oil droplet demulsification in an emulsion under a pulsed-DC electric field were studied by molecular dynamics (MD) simulation. The MD simulation results show that oil droplets underwent directional movement under the action of an electric field. The larger the electric field strength, the shorter the time required for the oil droplets to coalesce. However, the movement direction of the oil droplets in the electric field was different depending on the type of surfactant. Compared to oil droplets containing SDS, oil droplets containing CTAB molecules exhibited faster deformation and easier migration coalescence under low electric field strength. It was mainly attributed to the fact that the deformation of oil droplets will be accelerated when oil droplets contain asphaltene molecules and surfactant molecules with different electronegativities under an electric field. During the demulsification of oil droplets containing CTAB molecules, CTAB molecules generated electrostatic attraction with asphaltene molecules in adjacent oil droplets, strengthened the interaction between oil droplets, and promoted the demulsification of oil droplets. In the process of oil droplet demulsification containing SDS molecules, the potential energy of the electrostatic interaction between oil droplets did not change, and the demulsification mainly depended on the van der Waals force between oil droplets.