In this paper, stochastic operational matrix of integration based on delta functions is applied to obtain the numerical solution of linear and nonlinear stochastic quadratic integral equations (SQIEs) that appear in modelling of many real problems. An important advantage of this method is that it dose not need any integration to compute the constant coefficients. Also, this method can be utilized to solve both linear and nonlinear problems. By using stochastic operational matrix of integration together collocation points, solving linear and nonlinear SQIEs converts to solve a nonlinear system of algebraic equations, which can be solved by using Newton's numerical method. Moreover, the error analysis is established by using some theorems. Also, it is proved that the rate of convergence of the suggested method is O(h2). Finally, this method is applied to solve some illustrative examples including linear and nonlinear SQIEs. Numerical experiments confirm the good accuracy and efficiency of the proposed method.