Context. Solar flares strongly affect the Sun's atmosphere as well as the Earth's environment. Quantifying the maximum possible energy of solar flares of the present-day Sun, if any, is thus a key question in heliophysics. Aims. The largest solar flares observed over the past few decades have reached energies of a few times 10 32 erg, possibly up to 10 33 erg. Flares in active Sun-like stars reach up to about 10 36 erg. In the absence of direct observations of solar flares within this range, complementary methods of investigation are needed to assess the probability of solar flares beyond those in the observational record. Methods. Using historical reports for sunspot and solar active region properties in the photosphere, we scaled to observed solar values a realistic dimensionless 3D MHD simulation for eruptive flares, which originate from a highly sheared bipole. This enabled us to calculate the magnetic fluxes and flare energies in the model in a wide paramater space. Results. Firstly, commonly observed solar conditions lead to modeled magnetic fluxes and flare energies that are comparable to those estimated from observations. Secondly, we evaluate from observations that 30% of the area of sunspot groups are typically involved in flares. This is related to the strong fragmentation of these groups, which naturally results from sub-photospheric convection. When the model is scaled to 30% of the area of the largest sunspot group ever reported, with its peak magnetic field being set to the strongest value ever measured in a sunspot, it produces a flare with a maximum energy of ∼6 × 10 33 erg. Conclusions. The results of the model suggest that the Sun is able to produce flares up to about six times as energetic in total solar irradiance fluence as the strongest directly observed flare of Nov. 4, 2003. Sunspot groups larger than historically reported would yield superflares for spot pairs that would exceed tens of degrees in extent. We thus conjecture that superflare-productive Sun-like stars should have a much stronger dynamo than in the Sun.