Nanoencapsulated phase change materials (nePCMs)-which are composed of a core with a phase change material and of a shell that envelopes the core-are currently under research for heat storage applications. Mechanically, one problem encountered in the synthesis of nePCMs is the failure of the shell due to thermal stresses during heating/cooling cycles. Thus, a compromise between shell and core volumes must be found to guarantee both mechanical reliability and heat storage capacity. At present, this compromise is commonly achieved by trial and error experiments or by using simple analytical solutions. On this ground, the current work presents a thermodynamically consistent and three-dimensional finite element (FE) formulation considering both solid and liquid phases to study thermal stresses in nePCMs. Despite the fact that there are several phase change FE formulations in the literature, the main novelty of the present work is its monolithic coupling-no staggered approaches are required-between thermal and mechanical fields. Then, the FE formulation is implemented in a computational code and it is validated against onedimensional analytical solutions. Finally, the FE model is used to perform a thermal stress analysis for different nePCM geometries and materials to predict their mechanical failure by using the Rankine's criterion.