Inside cells infected with a herpes virus, a viral enzyme called thymidine kinase changes acyclovir into an active form, and the cell's own enzymes finish the job. The active form blocks the enzyme the virus uses to copy its DNA, and it also gets built into the new viral DNA and stops the strand from growing. Because the first step needs the viral enzyme, the drug acts mostly in infected cells. It works more strongly against herpes simplex than against the chickenpox and shingles virus, because the herpes simplex enzyme activates it more efficiently.
Only a small share of a tablet dose is absorbed, and larger doses are absorbed less efficiently, while the IV form reaches much higher blood levels. With healthy kidneys, half of it leaves the blood in about 2.5 to 3.3 hours, and the kidneys remove most of it unchanged in the urine. Because it dissolves poorly, it can form crystals in the kidney tubes when given too fast, in high doses, or to someone who is dehydrated, and this can lead to kidney failure. Herpes viruses can become resistant to it, mainly in people with weak immune systems such as those with advanced HIV.