Numbers 8:16

8:16 For they are entirely given to me from among the Israelites. I have taken them for myself instead of all who open the womb, the firstborn sons of all the Israelites.

Numbers 18:15

18:15 The firstborn of every womb which they present to the Lord, whether human or animal, will be yours. Nevertheless, the firstborn sons you must redeem, and the firstborn males of unclean animals you must redeem.