Aromatic acids dissociate to give a carboxylate anion and proton.
\(C_6H_5COOH \rightleftharpoons C_6H_5COO^ - +H^ +\)
Since the carboxylate anion (ArCOO-) is resonance stabilised to a greater extent than the carboxylic acid (ArCOOH), the equilibrium of the above equation lies towards the right, ie. towards the dissociation of the acid.

As in aliphatic acids, the presence of an electron-withdrawing substituent (eg. -NO2,-Cl-SO3H, etc.) disperses the negative charge of the carboxylate anion and thus stabilises it and hence increases the acidity of the parent benzoic acid. On the other hand, presence of an electron-releasing substituent (e.g., - CH3, -OH, -OCH3, etc.) intensifies the negative charge of the carboxylate anion and thus destabilises it and hence decreases the acidity of the parent benzoic acid.
The overall influence of a substituent on acidity of substituted benzoic acids is due to two factors.
(i) Inductive effect : If the substituent exerts -I effect, it increases the acidity of carboxylic acids, while if it exerts + I effect it decreases the acidity. Inductive effect affects all positions, ie, o- m- and p-.
(ii) Resonance effect : Like inductive effect, if the resonance producing group exerts minus effect ie, if it withdraws electrons, it increases the strength of the benzoic acid. Similarly, if the group causes + R effect it decreases the acidity of benzoic acid. However, remember that resonance effect affects only o- and p- positions. Thus if resonance producing group is present in the m-position it will not exert its effect.
In case resonance and inductive effects both operate in the molecule, resonance effect being stronger overpowers the inductive effect.
Thus on the above basis, the following order of acidity can be explained.


Now let us study the relative acidity of the various nitrobenzoic acids (having electron withdrawing group) and hydroxy benzoic acids (having electron-releasing group). The three isomeric nitrobenzoic acids follow the following order.

The ortho-isomer of every substituted benzoic acid is the strongest acid among the three isomers due to ortho effect. Among the p-nitro and m-nitro-benzoic acids the latter isomer is a weak acid because in this isomer acidity is only due to electron withdrawing inductive effect of the -NO2 group (resonance does not affect the m-position) while in the p-isomer acidity is due to electron withdrawing inductive as well as resonance effect.
The acidity of the three isomers of hydroxybenzoic acids follows the following order.

The OH group is electron-releasing due to the resonance effect of the unshared pair of electrons on oxygen, simultaneously it exerts electron-withdrawing inductive effect due to the presence of highly electronegative oxygen. In the p-isomer, the acid-weakening electron-releasing resonance effect outweighs the acid- strengthening electron-withdrawing inductive effect, hence p-hydroxybenzoic acid is a weaker acid than benzoic acid (not having acid-weakening -OH group). In the m-isomer, resonance effect cannot operate and hence only the acid-strengthening -I effect takes part with the result m-hydroxybenzoic acid is stronger acid than benzoic acid. Like other substituted benzoic acids, o-hydroxybenzoic acid, although has electron-releasing group, is unusally very strong acid than its other isomers and even benzoic acid. This is of course due to ortho effect.
Similar explanation can be given for methoxy- benzoic acids.
