Calculating sample size typically involves statistical formulas or software. Basic sample size calculations consider the effect size, variance, significance level, and power. For more complex designs, specialized software such as G*Power, PASS, or statistical programming languages like R can be used.