The multi-energy system (MES) provides a good environment for the local consumption of renewable energy such as wind and solar power because of its high operational flexibility. In the MES, the hybrid energy storage system (HESS) composed of the battery and thermal storage tank plays an important role in enhancing reliability, economics, and operational flexibility. Hence, determining the optimal size of HESS in the MES is a critical problem but has not received enough attention. In light of this problem, this paper focuses on the optimal HESS planning problem in the community MES (CMES) under diverse uncertainties. Firstly, a two-stage stochastic planning model is proposed for the CMES to coordinate the optimal long-term HESS allocation and the short-term system operation. The thermal inertia in the heating network, space heating demand, and domestic hot water demand is utilized to reduce both the planning and operational cost. Secondly, a deterministic equivalence is proposed for the two-stage planning model to convert it into a mixed-integer linear programming model, which is then solved by off-the-shelf solvers. Finally, simulation results verify the effectiveness of the proposed method. The results reveal that the HESS can enhance the operational flexibility of the CMES but only needs a very few investment costs and prove that the thermal inertia in the CMES can reduce the investment cost of HESS, the fuel, and the operational maintenance cost.INDEX TERMS Battery, community multi-energy system, hybrid energy storage system, mixed-integer linear programming, operational flexibility, renewable energy, thermal storage tank, two-stage stochastic programming, uncertainty.