Algorithm for pedestrian flow analysis based on DEM(Discrete Element Method) is newly developed. There are lots of similarity between particle-laden two phase flow and pedestrian flow. The velocity component of carrier phase corresponds to the direction vector of calculation cell, dispersed phase to people, volume fraction to population density and the momentum equation of particle to the walking velocity and way-finding method of passenger. And, the walking velocity of passenger is also represented by the function of population density. Key algorithms are developed to determine the position of people, population density and numbering method. To verify the effectiveness of algorithm for pedestrian flow analysis, simulations for representative simple models are conducted. By using the developed simulation program, We can simulate the movement of massive crowd qualitatively and quantitatively.