Classification of channel codes has drawn widespread concern for a long time. In this letter, we propose a posteriori probability based approach to classify cyclic redundancy check codes and convolutional codes. We defined the posteriori probability spectrum to clarify the parity-check relationship between the intercepted codewords and the candidate parity-check vector generated by traversing. We theoretically explained that the posteriori probability spectrum of cyclic redundancy check codes and convolutional codes show clear distinctions. We further specify the feature parameter generated from the posteriori probability spectrum to do classification. Simulation results show that the posteriori probability spectrum for cyclic redundancy check codes and convolutional codes are significantly different. The proposed approach outperforms traditional Gauss-Jordan elimination through pivoting approach in classification accuracy.