Disclosed are a variety of amphoteric compounds containing a quaternary nitrogen group, a covalently bound counterion, and an ester or amide group. These amphoteric compounds can be advantageously prepared via a chemoenzymatic green process, and exhibit good surfactant properties.