We address the question of constructing simple inviscid vortex models that optimally approximate realistic flows as solutions of an inverse problem. Assuming the model to be incompressible, inviscid and stationary in the frame of reference moving with the vortex, the ‘structure’ of the vortex is uniquely characterized by the functional relation between the streamfunction and vorticity. It is demonstrated how the inverse problem of reconstructing this functional relation from data can be framed as an optimization problem which can be efficiently solved using variational techniques. In contrast to earlier studies, the vorticity function defining the streamfunction–vorticity relation is reconstructed in the continuous setting subject to a minimum number of assumptions. To focus attention, we consider flows in three-dimensional axisymmetric geometry with vortex rings. To validate our approach, a test case involving Hill's vortex is presented in which a very good reconstruction is obtained. In the second example, we construct an optimal inviscid vortex model for a realistic flow in which a more accurate vorticity function is obtained than produced through an empirical fit. When compared with available theoretical vortex-ring models, our approach has the advantage of offering a good representation of both the vortex structure and its integral characteristics.