The ideal stability of the internal kink mode is analysed for realistic tokamak geometry. Accurate numerical results demonstrate convergence with Bussac's toroidal solution (Bussac M N, Pellat R, Edery D and Soulé J L 1975 Phys. Rev. Lett. 35 1638) for inverse aspect ratio ϵ1 ∼ 0.01 at the q = 1 rational surface. For realistic inverse aspect ratio (e.g. ϵ1 ∼ 0.1) the growth rate is found to scale linearly with the poloidal beta and to be smaller than the analytical prediction of the toroidal growth rate. The effect of the shaping of the plasma cross-section is also analysed. Analytical results are found to disagree with numerical results at realistic inverse aspect ratio primarily because of the toroidal nature of the Mercier mode shaping terms. Furthermore, in addition to the Mercier shaping terms, there are quasicylindrical contributions to the kink mode which are quadratic and stabilizing in both triangularity and ellipticity. To verify this empirically and to further demonstrate the importance of the ideal internal kink stability boundary, discharges in the tokamak à configuration variable are shown to display longer sawteeth for both very positive and negative triangularity. Finally, a parameter scan in the triangularity, elongation, aspect ratio and poloidal beta has been undertaken using the code KINX. Versatile predictions of the ideal internal kink stability in future tokamaks should be assisted by the functional fitting presented here of the parameter scans.