For a positive integer π, let π 0 (π) be the modular curve over π and π½ 0 (π) its Jacobian variety. We prove that the rational cuspidal subgroup of π½ 0 (π) is equal to the rational cuspidal divisor class group of π 0 (π) when π = π 2 π for any prime π and any squarefree integer π. To achieve this, we show that all modular units on π 0 (π) can be written as products of certain functions πΉ π,β , which are constructed from generalized Dedekind eta functions. Also, we determine the necessary and sufficient conditions for such products to be modular units on π 0 (π) under a mild assumption.