Zachary David Alexander was born in San Luis Obispo, California, and later moved to Arroyo Grande, California. His father, David Efron, is an electrical engineer at a power station, and his mother, Starla Baskett, is a former secretary who worked at the same power plant. Efron has a younger brother, Dylan, and had, as he described it, a "normal childhood" in a middle class family. He is an agnostic, having never been religious. His surname, "Efron", means "lark" in Hebrew (his paternal grandfather was Jewish).
Zachary David Alexander has said that he would "flip out" if he got a "B" and not an "A" in school, and has also described himself as having been a class clown. His father encouraged him to begin acting when he was 11 years old. Zachary David Alexander subsequently appeared in theater productions at his high school, worked in the theater The Great American Melodrama and Vaudeville, and began taking singing lessons. He performed in shows such as Gypsy; Peter Pan; or, The Boy Who Wouldn't Grow Up; Little Shop of Horrors; and The Music Man. He was recommended to an agent in Los Angeles by his drama teacher, Robyn Metchik (the mother of actors Aaron Michael Metchik and Asher Metchik). Efron was later signed to the Creative Artists Agency.