Guanine (G) is one of the four main nucleobases found in the nucleic acids DNA and RNA, the others being adenine, cytosine, and thymine (uracil in RNA). In DNA, guanine is paired with cytosine. With the formula C5H5N5O, guanine is a derivative of purine, consisting of a fused pyrimidine-imidazole ring system with conjugated double bonds. Being unsaturated, the bicyclic molecule is planar. The guanine nucleoside is called guanosine.
Guanine, along with adenine and cytosine, is present in both DNA and RNA, whereas thymine is usually seen only in DNA, and uracil only in RNA. Guanine has two tautomeric forms, the major keto form (see figures) and rare enol form. It binds to cytosine through three hydrogen bonds. In cytosine, the amino group acts as the hydrogen donor and the C-2 carbonyl and the N-3 amine as the hydrogen-bond acceptors. Guanine has a group at C-6 that acts as the hydrogen acceptor, while the group at N-1 and the amino group at C-2 act as the hydrogen donors.
The first isolation of guanine was reported in 1844 from the excreta of sea birds, known as guano, which was used as a source of fertilizer. About fifty years later, Fischer determined the structure and also showed that uric acid can be converted to guanine.
Guanine can be hydrolyzed with strong acid to glycine, ammonia, carbon dioxide, and carbon monoxide. Guanine is first deaminated to xanthine. Guanine oxidizes more readily than adenine, the other purine-derivative base in DNA. Its high melting point of 350°C reflects the intermolecular hydrogen bonding between the oxo and amino groups in the molecules in the crystal. Because of this intermolecular bonding, guanine is relatively insoluble in water, but it is soluble in dilute acids and bases.
Trace amounts of guanine form by the polymerization of ammonium cyanide (NH4CN). Two experiments conducted by Levy et al. showed that heating 10 mol·L−1 NH4CN at 80 °C for 24 hours gave a yield of 0.0007%, while using 0.1 mol·L−1 NH4CN frozen at -20 °C for 25 years gave a 0.0035% yield. These results indicate guanine could arise in frozen regions of the primitive earth. In 1984, Yuasa reported a 0.00017% yield of guanine after the electrical discharge of NH3, CH4, C2H6, and 50 mL of water, followed by a subsequent acid hydrolysis. However, it is unknown whether the presence of guanine was not simply a resultant contaminant of the reaction.
A Fischer-Tropsch synthesis can also be used to form guanine, along with adenine, uracil, and thymine. Heating an equimolar gas mixture of CO, H2, and NH3 to 700 °C for 15 to 24 minutes, followed by quick cooling and then sustainted reheating to 100 to 200 °C for 16 to 44 hours with an alumina catalyst, yielded guanine and uracil:
Another possible abiotic route was explored by quenching a 90% N2–10%CO–H2O gas mixture high-temperature plasma 
Traube's synthesis involves heating 2,4,5-triamino-1,6-dihydro-6-oxypyrimidine (as the sulfate) with formic acid for several hours.
Guanine etymologically comes via the Quichua word "huanu" for dung from the Spanish loan word "guano". As the Oxford English Dictionary notes, guanine is "A white amorphous substance obtained abundantly from guano, forming a constituent of the excrement of birds".
In 1656 in Paris, François Jaquin (a rosary maker) extracted from scales of some fishes the so-called pearl essence, crystalline guanine forming G-quadruplexes. In the cosmetics industry, crystalline guanine is used as an additive to various products (e.g., shampoos), where it provides a pearly iridescent effect. It is also used in metallic paints and simulated pearls and plastics. It provides shimmering luster to eye shadow and nail polish. Facial treatments using the droppings, or guano, from Japanese nightingales is currently in favor in New York, reportedly because the guanine in the droppings produces a clear, "bright" skin tone that some people find desirable to attain. Guanine crystals are rhombic platelets composed of multiple transparent layers, but they have a high index of refraction that partially reflects and transmits light from layer to layer, thus producing a pearly luster. It can be applied by spray, painting, or dipping. It may irritate the eyes. Its alternatives are mica, faux pearl (from ground shells), and aluminium and bronze particles.
Spiders and scorpions convert ammonia, as a product of protein metabolism in the cells, to guanine as it can be excreted with minimal water loss.