The time‐of‐flight secondary ion mass spectrometry (ToF‐SIMS) positive and negative ion spectra of poly(2‐vinylpyridine) (P2VP) and poly(4‐vinylpyridine) (P4VP) were analyzed using density functional theory calculations. Most of the ions from these structural isomers shared the same accurate mass, but had different relative abundance. This could be attributed to the fact that from a thermodynamics perspective, the disparity in the molecular structures can affect the ion stability if we assume that they shared the same mechanistic pathway of formation with similar reaction kinetics. The molecular structures of these ions were assigned, and their stability was evaluated based on calculations using the Kohn‐Sham density functional theory with Becke's 3‐parameter Lee‐Yang‐Parr exchange‐correlation functional and a correlation‐consistent, polarized, valence, double‐zeta basis set for cations and the same basis set with a triple‐zeta for anions. The computational results agreed with the experimental observations that the nitrogen‐containing cations such as C5H4N+ (m/z = 78), C8H7N+· (m/z = 117), C8H8N+ (m/z = 118), C9H8N+ (m/z = 130), C13H11N2+ (m/z = 195), C14H13N2+ (m/z = 209), C15H15N2+ (m/z = 223), and C21H22N3+ (m/z = 316) ions were more favorably formed in P2VP than in P4VP due to higher ion stability because the calculated total energies of these cations were more negative when the nitrogen was situated at the ortho position. Nevertheless, our assumption was invalid in the formation of positive ions such as C6H7N+˙ (m/z = 93) and C8H10N+ (m/z = 120). Their formation did not necessarily depend on the ion stability. Instead, the transition state chemistry and the matrix effect both played a role. In the negative ion spectra, we found that nitrogen‐containing anions such as C5H4N− (m/z = 78), C6H6N− (m/z = 92), C7H6N− (m/z = 104), C8H6N− (m/z = 116), C9H10N− (m/z = 132), C13H11N2− (m/z = 195), and C14H13N2− (m/z = 209) ions were more favorably formed in P4VP, which is in line with our computational results without exception. We speculate that whether anions would form from P2VP and P4VP is more dependent on the stability of the ions.