The main aim of this paper is to apply non-negative matrix factorization to build a recommender system. In a recommender system there are a group of users that rate to a set of items. These ratings can be represented by a rating matrix. The main problem is to estimate the unknown ratings and then predict the interests of the users to the items which haven’t rated. The main innovation of this paper is to propose a new algorithm to compute matrix factorization in a way that the factorized matrixes would be a good approximation for the initial rating matrix and moreover would be a good source to predict the unknown ratings of the items precisely. The results show that the proposed matrix factorization improves the estimated ratings considerably.