Designs of MEMS and NEMS devices are gaining importance for their stable and efficient operation with their shrinking structures. Boundary element method is a widely used method for design of such devices, recently. In this study, finite difference method, which is expressed as classical methods, and boundary element method, which is a newer method compared to finite element method, was investigated. To examine the performance of boundary element method in MEMS design, the scalar magnetic potential formed outside the MEMS plate was analyzed. Firstly, the boundaries of problem region are divided with a fixed boundary element and the problem is modeled by defining Dirichlet boundary conditions. A new program has been developed in Matlab environment to solve the problem. The designed program automatically solves the finite element method and the boundary element method in two-dimensional problem region whose limits and number of elements are determined. To check the accuracy of the results, the problem was solved analytically and all results were compared. According to the results obtained in the application, it can be stated that boundary element method has many positive aspects in terms of the data required for problem solving, the ease of application and the accuracy of the results according to the finite element method. According to the results obtained in this study, it may be suggested to use the boundary element method in detection of electrostatic and magnetostatic sensing distances of MEMS and NEMS devices. The developed program can contribute to better design of such devices.