The flapping motion of inverted flags with various shapes in a uniform flow were simulated by using the immersed boundary method. The shapes of the flags were characterized in terms of the shape ratio (S = $W_T/W_L$), i.e., the ratio of the trailing edge width ($W_T$) to the leading edge width ($W_L$). To explore the effects of varying S on the flapping dynamics of inverted flags, the peak-to-peak amplitude (A/L) and the Strouhal number ($S_t$) were determined as functions of the bending rigidity (0.1 ≤ $\gamma$ ≤ 0.3) and the shape ratio (0.5 ≤ S ≤ 2). The vortical structures behind the inverted flag were visualized by using the Q-criterion to elucidate the vortex dynamics. The hydrodynamic forces exerted on each inverted flag were analyzed to find the correlation between its kinematics and vortex formation during the flapping period of the inverted flag. The strain energy ($E_s$) stored in the inverted flag and the ratio (R) of the conversion of flow kinetic energy to strain energy were also determined. Finally, we explored the effects of varying the shape ratio S' = $W_T/W_L$ while keeping the trailing edge width constant ($W_T$ = 1) instead of the area of inverted flag. The Strouhal number is maximized at S' = 1. The conversion ratio of S' = 2 is 2.5% higher than that of S' = 1.