Nucleic acids are complex organic molecules that form the basis of genetic material in all living organisms. They include DNA (deoxyribonucleic acid) and RNA (ribonucleic acid). DNA is responsible for storing and transmitting genetic information, while RNA plays a crucial role in translating this information into proteins.