The studies of number sense in different species are severely hampered by the inevitable entanglement of non-numerical attributes inherent in nonsymbolic stimuli representing numerosity, resulting in contrasting theories of numerosity processing. Here, we developed an algorithm and associated analytical methods to generate stimuli that not only minimized the impact of non-numerical magnitudes in numerosity perception but also allowed their quantification. We trained number-naïve rats with these stimuli as sound pulses representing two or three numbers and demonstrated that their numerical discrimination ability mainly relied on numerosity. Also, studying the learning process revealed that rats used numerosity before using magnitudes for choices. This numerical processing could be impaired specifically by silencing the posterior parietal cortex. Furthermore, modeling this capacity by neural networks shed light on the separation of numerosity and magnitudes extraction. Our study helps dissect the relationship between magnitude and numerosity processing, and the above different findings together affirm the independent existence of innate number and magnitudes sense in rats.