In this paper, a new method based on two-dimensional Legendre wavelet basis is proposed to solve time-fractional diffusion equations. This technique is used to convert the problem into a system of linear algebraic equations via expanding the required approximation based on the Legendre wavelet basis. The effectiveness of the proposed method is examined by comparing the numerical results with other methods. When the desired system is large, it is ill-conditioned; in this case, Tikhonov regularization method, with discrepancy principle for finding the regularization parameter, is applied to stabilize the solution.