Understanding and quantifying uncertainty factors are crucial for accurately predicting thermomagnetic convection phenomena. This study presented a mathematical model and algorithm framework for uncertainty analysis of thermomagnetic convection in porous media with random porosity. The proposed method combined Karhunen-Loève expansion and intrusive polynomial chaos expansion to represent the input random parameters and output response, respectively. The Galerkin projection method was employed to decouple the stochastic governing equations of thermomagnetic convection into deterministic governing equations that can be efficiently solved using the finite volume method. By solving the polynomial chaos expansion of the output response and employing the stochastic projection method to solve the associated decoupled governing equations, the temporal evolution and statistical characteristics of the output response were obtained. The study revealed that porosity uncertainty in the porous medium affects the thermomagnetic convection of paramagnetic fluid, exhibiting significant chaos effects. Monte Carlo simulations were performed to validate the accuracy of the proposed approach and demonstrate its computational efficiency compared to traditional Monte Carlo methods. This research provides valuable insights into the uncertainty analysis of thermomagnetic convection and offers a promising methodology for analyzing heat transfer in various porous media applications.