The invention discloses a method for preventing boats from colliding, comprising the following steps: performing program initialization; reading information of any two boats, predicting the track of the boats; judging whether the predicted tracks of two boats intersect, if not, returning to step 2 to continue reading the information of any other two boats to predict the tracks of other boats, if yes, calculating the intersection point, and entering the next step; calculating the intersection point, and using a Mercator projection transformation formula to calculate the distance between the intersection boats and the intersection point and a time zone from the boats to the intersection point; judging whether the time zones of two boats have intersection, if not, returning to step 2 to continue reading the information of any other two boats to predict the tracks of other boats; if yes, entering the next step; and giving alarms. The invention uses the Mercator projection transformation, which ensures that the distance between any two points is more accurate and prediction results are more correct; in addition, the invention adopts the judging method of the time zone, which can comprehensively predict time for boats to travel to a designated site, so that the reliability of the prediction result can be improved.