The coupling between fermionic matter and gauge fields plays a fundamental role in our understanding of nature, while at the same time posing a challenging problem for theoretical modeling. In this situation, controlled information can be gained by combining different complementary approaches. Here, we study a confinement transition in a system of N f flavors of interacting Dirac fermions charged under a U(1) gauge field in 2+1 dimensions. Using Quantum Monte Carlo simulations, we investigate a lattice model that exhibits a continuous transition at zero temperature between a gapless deconfined phase, described by three-dimensional quantum electrodynamics, and a gapped confined phase, in which the system develops valence-bond-solid order. We argue that the quantum critical point is in the universality class of the QED 3 -Gross-Neveu-XY model. We study this field theory within a 1/N f expansion in fixed dimension as well as a renormalization group analysis in 4 − space-time dimensions. The consistency between numerical and analytical results is revealed from large to intermediate flavor number.