This paper develops a general framework for conducting inference on the rank of an unknown matrix Π0. A deﬁning feature of our setup is the null hypothesis of the form H0 : rank(Π0) ≤ r. We argue that the problem is of ﬁrst order importance because the previous literature instead focuses on H0 0 : rank(Π0) = r by implicitly assuming away rank(Π0) < r, which may lead to over-rejections for some data generating processes and under-rejections for others (both having rank(Π0) < r). In particular, limiting distributions of test statistics under H0 0 may not stochastically dominate those under rank(Π0) < r. A multiple test on the nulls rank(Π0) = 0,...,r, though valid for H0, may be substantially conservative. We employ a testing statistic whose limiting distributions under H0 are highly nonstandard due to the inherent irregular natures of the problem, and then construct bootstrap critical values that deliver size control and improved power. Since our procedure relies on a tuning parameter, a two-step procedure is designed to mitigate concerns on this nuisance. We additionally argue that our setup is also important for estimation. Empirical relevance of our results is illustrated through a series of examples including testing identiﬁcation in linear IV models, inference on cointegration rank, estimation of the number of types in ﬁnite mixture models, and inference on sorting dimensions in a two-sided matching model with transferrable utility.