Electron donating substituents tends to decrease the acidic strength while electron withdrawing substituents tends to increase the acidic strength of substituted benzoic acids relative to benzoic acid. OCH3 exerts +M effect which destabilises the conjugate base
of the compound 2 and hence decreases the acidity, whereas NO2 exerts −M effect and stabilises the conjugate
hence increases the acidity. Thus, the correct order of acidity of the given compounds are