Many other formulas have been tested but the one that seems the most accurate is the one endorsed by the Old Farmer’s Almanac: To get a rough estimate of the temperature in degrees Fahrenheit, count the number of chirps in 14 seconds and then add 40. The number you get will be an approximation of the outside temperature.
The chirping of the more common field cricket is not as reliably correlated to temperature — its chirping rate varies depending on other factors such as age and mating success.