Hydrochloric acid (HCl) is a strong acid and dissociates completely in water:
\[
\text{HCl} \rightarrow \text{H}^+ + \text{Cl}^-
\]
Therefore, the concentration of hydrogen ions \([H^+]\) is equal to the concentration of HCl, which is 0.01 M.
The pH is calculated using the formula:
\[
\text{pH} = -\log [H^+]
\]
Substituting the values:
\[
\text{pH} = -\log (0.01) = 2
\]
Thus, the pH of the solution is 2.