We construct a Lagrangian for general nonlinear electrodynamics that features electric and magnetic potentials on equal footing. In the language of this Lagrangian, discrete and continuous electric-magnetic duality symmetries can be straightforwardly imposed, leading to a simple formulation for theories with the $SO(2)$ duality invariance. When specialized to the conformally invariant case, our construction provides a manifestly duality-symmetric formulation of the recently discovered ModMax theory. We briefly comment on a natural generalization of this approach to $p$-forms in $2p+2$ dimensions.