The invention relates to a method and a device for detecting ultrasonic time of flight. The method is characterized in that an ultrasonic generator generates square wave ultrasonic pulse train excitation signals with 50 percent of duty cycle, the upper limit of the number of square pulses contained by the excitation signals is set when the wave shape of the received ultrasonic pulse train is still in a diamond shape; a timer is started up at the falling edge of the last square pulse of the excitation signal, received ultrasonic pulse train finds the peak point of maximum pulse of amplitude through differential amplification, gain control, high Q value band-pass filter, half wave rectification, variable index amplification, threshold comparison, differential and zero-crossing detection, and the timer is turned off at the peak point. The method not only achieves the high precision of phase difference method, but also overcomes the defects that the phase difference method can only be applied at short distances, breaks the tradition, and has broad application.