We develop new goodness of fit test for uniform distribution based on a conditional moment characterization. We study the asymptotic properties of the proposed test statistic. We also present a goodness of fit test for uniform distribution to incorporate the right censored observations and studied its properties. A Monte Carlo simulation study is carried out to evaluate the finite sample performance of the proposed tests. We illustrate the test procedures using real data sets.