Spatial transcriptomic technologies are becoming increasingly high-resolution, enabling precise measurement of gene expression at the subcellular level. Here, we introduce a computational method called subcellular expression localization analysis (ELLA), for modeling the subcellular localization of mRNAs and detecting genes that display spatial variation within cells in high-resolution spatial transcriptomics. ELLA creates a unified cellular coordinate system to anchor diverse cell shapes and morphologies, utilizes a nonhomogeneous Poisson process to model spatial count data, leverages an expression gradient function to characterize subcellular expression patterns, and produces effective control of type I error and high statistical power. We illustrate the benefits of ELLA through comprehensive simulations and applications to four spatial transcriptomics datasets from distinct technologies, where ELLA not only identifies genes with distinct subcellular localization patterns but also associates these patterns with unique mRNA characteristics. Specifically, ELLA shows that genes enriched in the nucleus exhibit an abundance of long noncoding RNAs or protein-coding mRNAs, often characterized by longer gene lengths. Conversely, genes containing signal recognition peptides, encoding ribosomal proteins, or involved in membrane related activities tend to enrich in the cytoplasm or near the cellular membrane. Furthermore, ELLA reveals dynamic subcellular localization patterns during the cell cycle, with certain genes showing decreased nuclear enrichment in the G1 phase while others maintain their enrichment patterns throughout the cell cycle. Overall, ELLA represents a calibrated, powerful, robust, scalable, and versatile tool for modeling subcellular spatial expression variation across diverse high-resolution spatial transcriptomic platforms.