# Why are the degrees of freedom for the distribution of the t-test "n-1" and not "n-2" when both the sample mean and variance are estimated?

The common way to determine the degrees of freedom is to subtract 1 from n for each parameter that has been estimated. $$T_{n} = \sqrt{n} \frac{x̄-\mu}{s}$$ Here I estimate both the mean and the sd to calculate T.

Assuming that the distribution of the data is normal, why do we get n-1 and not n-2 df?

(I understand the process to demonstrate that the distribution with n-1 is correct, I just can't grasp why the rule doesn't seem to hold here, maybe I'm getting something wrong)

In some sense this is just the definition: a $$t_{n-1}$$ variable was defined as one where the denominator is the square root of a $$\chi^2_{n-1}$$.
More helpfully, it's the denominator degrees of freedom that we're talking about, ie, degrees of freedom for estimating $$s$$, and there we do have just one previously estimated parameter to account for, with $$n-1$$ df left for estimating $$s$$.