The basic formula is Coefficient for Exercise * Weight in KG * Distance in KM = Total Number of calories
A notable element missing from this formula is time. There is a fundamental assumption that the number of calories burned will be directly related to your weight, the distance you travel and Coefficient of the given exercise rather than how fast you actually travel. As such time is largely irrelevant.
It is a given that moving a mass a given distance will require a set amount of energy. What is more complicated is how efficient you move that mass which is the Coefficient part of the formula. Cycling is unarguably more efficient than running. However there is a lot debate around whether walking burns the same amount of calories than running. The argument basically goes that regardless of walking or running if you travel a set distance say 5km an your weight is say 75kg the net effect is that you have transferred the same weight across the same distance, it is only that you have done it more quickly hence why running appears to burns more than walking. Whilst I believe there is a relationship between distance and weight, I think there is also a relationship between your center of gravity and your weight. When walking you tend to walk along fairly smoothly with little upwards or downwards movement. However when running you have to lift your weight up off the ground to get a bigger stride. In addition when you land your knees bend to absorb the shock. So when running you are shifting your weight up and down more than if you where walking as such running is not as efficient as walking and will burn more calories hence will have a different Coefficient. Working on your running technique is important as it gives you the tools to be a enable an you to run faster using the same amount of energy.
It is important to note that this calculator is only at best a rough estimate and various other conditions can affect the result such as the terrain, equipment, weather , the individual (fit, running style, heart rate) . All these impact and affect the actual number of calories burned however this calculator gives a guide which can be useful in planning your food.
Kilograms * Kilometers * Coefficient