The element differential method (EDM) is a robust and efficient strong-form numerical method, which has attracted a lot of attention of the researchers about the numerical methods since proposed. EDM has higher stability than some other strong-form methods and is more efficient than conventional Galerkin FEM. In this paper, the EDM is combined with Solid Isotropic Material with Penalization (SIMP) method to solve 2–3D topological optimization problems under different conditions. The key of the paper is to derive the objective function of second-order EDM element, which is suitable for the SIMP-based topology optimization process. And the sensitivity is solved by Optimality Criteria (OC) method. In the article, topology optimization examples are considered in different mechanics or thermal loads. In the topology optimization of the elastic problem of 3D cantilever beam, the EDM-based SIMP method can reduce the structural compliance by 17∼27% compared with SIMP method based on FEM. And in the heat transfer problems of the 3D plate, the EDM-based SIMP method reduced the compliance by 3.4%. The results show that the present method has good accuracy, efficiency and robustness in topology optimization of 2D and 3D minimum compatibility problems.