To address the problems of high energy consumption and time delay of the offloading strategies in traditional edge computing, a computation offloading strategy for the Internet of Things (IoT) using the improved Particle Swarm Optimization (PSO) in edge computing is proposed. First, a system model and an optimization objective function are constructed based on the communication model for the uplink transmission and the multiuser personalized computation task load model while considering constraints from multiple aspects. Then, the PSO is used to update the position of particles by encoding them and calculating the fitness values to find the optimal solution of the task offloading strategies, which greatly reduces the energy consumption during the task allocation process in the system. Finally, the simulations are conducted to compare the proposed method with two other algorithms in terms of the average time delay and energy consumption under different numbers of user mobile devices and data transmission rates. The simulation results showed that the average time delay and energy consumption of the proposed method are the smallest in different cases. And, the average delay and energy consumption are 0.205 s and 0.2 J, respectively, when the number of users’ mobile devices is 80, which are better than the other two comparison algorithms. Therefore, the proposed method can reduce the task execution delay with less energy consumption.