DDR4 or DDR5: which RAM should I choose?
Short answerYou cannot choose freely: your motherboard accepts only DDR4 or only DDR5. Check its model before you buy RAM.
The three generations have different notches and do not fit the same slot. DDR4 runs at 1.2 V and usually 2666 to 3600 MT/s. DDR5 runs at 1.1 V and starts at 4800 MT/s. Both have 288 pins but the notch is in a different place. DDR3 is older, at 1.5 V.
If you are building a new computer on a recent platform it will be DDR5. On an existing computer, check the motherboard manual or a program like CPU-Z.
The Handbook has a comparison table of DDR3, DDR4 and DDR5.