This paper studies an equity market of stochastic dimension, where the number of assets fluctuates over time. In such a market, we develop the fundamental theorem of asset pricing, which provides the equivalence of the following statements: (i) there exists a supermartingale numeraire portfolio; (ii) each dissected market, which is of a fixed dimension between dimensional jumps, has locally finite growth; (iii) there is no arbitrage of the first kind; (iv) there exists a local martingale deflator; (v) the market is viable. We also present the optional decomposition theorem, which characterizes a given nonnegative process as the wealth process of some investment-consumption strategy. Furthermore, similar results still hold in an open market embedded in the entire market of stochastic dimension, where investors can only invest in a fixed number of large capitalization stocks. These results are developed in an equity market model where the price process is given by a piecewise continuous semimartingale of stochastic dimension. Without the continuity assumption on the price process, we present similar results but without explicit characterization of the numeraire portfolio.