Sapphire and ruby are both *corundum,* a crystal made of aluminum oxide, but with different colors due to trace amounts of various other chemicals. If it’s colored red, we call it ruby, otherwise we call it sapphire. There’s no difference between a red sapphire and a ruby (other than the name we give it).
Emerald is a totally different chemical compound, namely *beryl* or beryllium aluminium silicate, which can occur in its own range of colors depending on what trace elements it contains.
Diamond is yet another totally different chemical compound, made of pure carbon.
Latest Answers