Quantum entanglement as a resource plays a key role in the field of quantum computing and quantum communication. The controlled SWAP test has been used to detect pure state entanglement [S. Foulds, V. Kendon, T. Spiller, Quantum Sci. Technol. 6, 035002 (2021); J. L. Beckey, N. Gigena, P. J. Coles, Phys. Rev. Lett. 127, 140501 (2021)]. In this paper, we investigate that quantum circuits for the controlled SWAP test can be used to detect the entanglement of multipartite mixed state. Based on the measured probability of the quantum circuits, we propose entanglement criteria for detecting multipartite entanglement and genuine entanglement of pure states. In addition, we give representation of the entanglement measures based on the measured probability of the controlled SWAP tests. Numerical examples are used to illustrate the efficiency of the entanglement criteria.