Block detection is one of the important steps in all discontinuous methods of analysis such as discontinuous deformation analysis and discrete element method. It is in fact a pre-processing step for these methods. This paper describes a new approach to the problem of geometrically defining polyhedral rock blocks created by the intersection of planar discontinuities in a rock mass. An approach is developed based on the concept of using matrices with integer elements that mostly represent vertices, edges, or face numbers and their connections. Using square matrices with integer elements and performing edge/face regularization reduce the size of the matrices because of elimination of unnecessary faces, edges, and vertices; speed and accuracy of block tracing operation will be increased. This algorithm is able to trace and identify all kinds of blocks including convex and concave blocks formed by limited or unlimited fractures. The simplicity of the procedure makes it very attractive. The algorithm was programmed in C#.Net by over 8100 code lines; several examples are presented to show application of the algorithm in different situations. Copyright © 2011 John Wiley & Sons, Ltd.