In this paper we propose a new method of power and sample size calculation in dependent t test and independent t test. In practice, power and sample size are commonly calculated using textbook formulas that involve both effect size and some nuisance parameters. For example, the nuisance parameter can be the correlation between two measures in dependent t test, and variance ratio of the two groups in independent t test. While researchers can specify the size of effect to be detected, the nuisance parameter is usually estimated from a previous study or a pilot study. Thus, there is randomness in the nuisance parameter estimate. In most studies, the point estimate of nuisance parameter is used, which ignored its uncertainty. To improve the estimation accuracy and computation efficiency, we construct the confidence intervals of power or sample size from the confidence interval of the nuisance parameter to account for its randomness. Simulation studies were conducted to compare different bootstrap methods, maximum likelihood and Delta method in constructing the confidence intervals.