Nitro group is an electron withdrawing group and thus it attracts the electron density of the ring and also affects the O-H bond of the alcohol group due to the resonance so that the Oxygen of OH-group snatches electron from the bond towards itself under the influence of nitro group and thus the O-H bond weakens and release of H+ ion becomes easy.This is whyphenol is less acidic than nitro phenols.
So,presence of Nitro group increases the acidic character of compound due to -I effect. This electron withdrowing effect decreases as we move from ortho to para position, hence the acidic character of ortho-Nitrophenol is lesser as compared to that of para-Nitrophenol, as electron withdrowing effect will be more effective to ortho position than that at para position.
Thanks & Regards
Sumit Kumar
askIITians Faculty