Taken from my answer here:
Comparing methane and acetylene shows a difference of $\approx 20$ $\mathrm pK_\mathrm a$ units
Comparing $\mathrm p K_\mathrm a$ of phenol($10.0$) and methanol($15.5$), we see that the presence of one resonating ring only produces a 5.5 $\mathrm p K_\mathrm a$ difference. Resonance in triphenyl system is effectively only one phenyl group at a time due to the steric effects due to the bulkiness of the phenyl groups.
Here methane and acetylene form anions where the negative charge on an $\mathrm{sp^3}$ and $\mathrm{sp}$ carbon respectively. Here, there is an electro negativity difference between the two carbons which leads to a very high difference in $\mathrm p K_\mathrm{a}$.
The difference between their electronegativities too large to explain the $\mathrm p K_\mathrm a$ difference of $15$. Nitrogen is $3$ and oxygen is $3.5$ on Pauling scale of electronegativity.
This small amount makes a big difference in $\mathrm p K_\mathrm a$ values. I say this because, if methane and acetylene have a difference of 20 units where the only difference is their hybridization and therefore electronegativity, oxygen and nitrogen will have a big difference in $\mathrm p K_\mathrm{a}$ values.
This can be seen in the actual values as referenced in Evan's $\mathrm pK_\mathrm a$ table, where aniline has a $\mathrm pK_\mathrm a$ value of $30.6$ and phenol has a $\mathrm p K_\mathrm a$ value of $18.0$ both referenced in DMSO.