Nucleic acids are DNA and RNA. DNA is a genetic material which is mainly present in the nucleus of the cell in eukaryotes like mammals. The genetic material is covered by a nuclear membrane. Mitochondria and chloroplast are the only organelles which are semi-autonomous which have their own DNA. Mitochondrial DNA is known as mt-DNA and the chloroplast is known as ct-DNA.
In prokaryotes like bacteria, the genetic material lies freely in the cytoplasm. The region where the nucleic acid is present is known as a nucleoid.
Virus mostly has RNA as genetic material. But some of the virus-like herpes virus has DNA as genetic material.