Edge computing has emerged as an innovative paradigm that decentralizes computation to the network’s periphery, empowering edge servers to manage user-initiated complex tasks. This strategy alleviates the computational load on end-user devices and increases task processing efficiency. Nonetheless, the task offloading process can introduce a critical vulnerability, as adversaries may infer a user’s location through an analysis of their offloading mode, thereby threatening the user’s location privacy. To counteract this vulnerability, this study introduces differential privacy as a protective mechanism to obscure the user’s offloading mode, thereby safeguarding their location information. This research specifically addresses the issue of location privacy leakage stemming from the correlation between a user’s location and their task offloading ratio. The proposed strategy is based on differential privacy. It aims to increase the efficiency of offloading services and the benefits of task offloading. At the same time, it ensures privacy protection. An innovative optimization technique for task offloading that maintains location privacy is presented. Utilizing this technique, users can make informed offloading decisions, dynamically adjusting the level of obfuscation in response to the state of the wireless channel and their privacy requirements. This study substantiates the feasibility and effectiveness of the proposed mechanism through rigorous theoretical analysis and extensive empirical testing. The numerical results demonstrate that the proposed strategy can achieve a balance between offloading privacy and processing overhead.