Abstract-Cloud computing is the latest emerging trend in distributed computing, where shared resources are provided to end-users in an on demand fashion that brings many advantages, including data ubiquity, flexibility of access, high availability of resources, and flexibility. In this type of systems many challenges are existed that the task scheduling problem is one of them. The task scheduling problem in Cloud computing is an NP-hard problem. Therefore, many heuristics have been proposed, from low level execution of tasks in multiple processors to high level execution of tasks. In this paper, we propose a new algorithm based on PSO to schedule the tasks in the Cloud. The results demonstrated that the proposed algorithm has a better operation in terms of task execution time, waiting time and missed tasks in comparison of First Come First Served (FCFS), Shortest Process Next (SPN) and Highest Response Ratio Next (HRRN).