Estimate water needed for a hike.
Water need is a rate multiplied by time, and the rate has three multipliers. Exertion sets the base at 0.4 litres an hour for easy walking up to 0.85 for hard work. Heat above 20 C then raises sweat rate by about 4.5 percent per degree, which means a 34 C day nearly doubles consumption. Altitude above 1500 metres adds respiratory water loss, since the air is dry and you breathe far more of it. What you carry is a separate question from what you need: with reliable refill points you only carry one leg's worth plus a half-litre reserve, and at a kilogram per litre that distinction dominates pack weight.
Consumption rate
L/h = base rate x heat factor x altitude factor
Carry volume
Carry = total litres / (refill points + 1) + 0.5 L reserve
General planning guidance, not medical advice. Hydration needs vary substantially between individuals and with medication, health conditions and acclimatisation. Both dehydration and over-drinking (hyponatraemia) are dangerous. Treat all water from natural sources, and seek medical guidance if you have a condition affecting fluid or electrolyte balance.
Sweat is how the body sheds heat, and the rate rises steeply with air temperature and workload. Above about 30 C a hard-working hiker can lose well over a litre and a half an hour. Underestimating this is the most common cause of heat exhaustion on day hikes in summer.
Filter whenever sources are genuinely reliable — water weighs a kilogram per litre and a filter weighs a couple of hundred grams. But confirm the sources exist and flow in the current season. Seasonal streams marked on a map are a common and dangerous assumption in late summer.