Usually, the notches will tell you. Compare a few in person and it's not hard to tell although the notch positions for DDR2, 3, etc can be a little harder to recognize from each other.
Different types of RAM can be identified by their physical characteristics, such as notches, number of pins, and module size, and by their DDR generation, clock speed, and voltage.
consumer RAM modules will come with a label to identify the type of RAM it is. Typically, these labels will either be a sticker applied directly to the stick of RAM, engraved onto the fancy heat spreader on higher-performance modules, or may be
RAM can be identified by their physical characteristics, such as notches, number of pins, and module size, and by their DDR generation, clock speed, and voltage.