Aims. We theoretically investigated the dimerization of methanimine, CH 2 =NH, a process that has been invoked to explain the formation of haze in the atmosphere of Titan and nitrogen organic compounds in interstellar/cometary ice analogs. Methods. We used density functional theory to characterize the minima and transition states of the investigated processes, while we computed the energetics with the more accurate coupled cluster method. We then obtained rate coefficients via combination of capture theory and statistical calculations. Results. The process involving two neutral molecules is characterized by significant energy barriers and cannot occur under the low temperature conditions of Titan or interstellar/cometary ices unless an external energy source is provided. On the contrary, the processes involving one molecule of either ionized or protonated methanimine are barrierless reactions and can therefore contribute to the formation of larger ions. In particular, the reaction involving ionized methanimine can also be efficient in the very low temperature conditions of the interstellar medium, leading to products of general formula C 2 N 2 H +
.Conclusions. The present work suggests that polymerization of methanimine is not an efficient process in space unless an ionization/protonation or a significant energy source is available.