Born in Malden, Massachusetts, Gardner graduated from Palo Alto High School in 1909, and received his only formal legal education at Valparaiso University School of Law in the state of Indiana. He attended law school for approximately 1 month, was suspended from school when his interest in boxing became a distraction, then settled in California where he became a self-taught attorney and passed the state bar exam in 1911. He opened his own law office in Merced, California, then worked for five years for a sales agency. In 1921, he returned to the practice of law, creating the firm of Sheridan, Orr, Drapeau and Gardner in Ventura, California .
In 1912, he married Natalie Frances Talbert; they had a daughter, Grace. Gardner practiced at the Ventura firm until 1933, when The Case of the Velvet Claws was published. Much of that novel was set at the historic Pierpont Inn, which was just down the road from his law office.
Gardner gave up the practice of law to devote full time to writing. In 1937 he moved to Temecula, California, where he lived for the rest of his life. In 1968 he married his long-time secretary Agnes Jean Bethell (1902-2002), the "real Della Street".
He died on March 11, 1970 in Temecula, California.
Gardner's ranch was known as Rancho del Paisano at the time. It was variously described as being , , or and was sold after his death to a Newport Beach couple. In 2001, the ranch was resold to the Pechanga Band of Indians, renamed into Great Oak Ranch and eventually adjoined to the Pechanga reservation.
In 2003, Temecula Valley Unified School District named a newly opened middle school after Gardner.
Innovative and restless in his nature, Gardner was bored by the routine of legal practice, the only part of which he enjoyed was trial work and the development of trial strategy. In his spare time, he began to write for pulp magazines, which also fostered the early careers of Dashiell Hammett and Raymond Chandler. He first story was published in 1923. He created many different series characters for the pulps, including the ingenious Lester Leith, a "gentleman thief" in the tradition of Raffles, and Ken Corning, a crusading lawyer who was the archetype of his most successful creation, the fictional lawyer and crime-solver Perry Mason, about whom he wrote more than eighty novels. With the success of Perry Mason, he gradually reduced his contributions to the pulp magazines, eventually withdrawing from the medium entirely, except for non-fiction articles on travel, Western history, and forensic science.
Gardner also devoted thousands of hours to a project called "The Court of Last Resort", which he undertook with his many friends in the forensic, legal and investigative communities. The project sought to review and, if appropriate, to reverse, miscarriages of justice against possibly innocent criminal defendants who were convicted owing to poor original legal representation or to the inadequate, careless or malicious actions of police and prosecutors and most especially, with regard to the abuse or misinterpretation of medical and other forensic evidence. The resulting 1952 book earned Gardner his only Edgar Award, in the Best Fact Crime category.
The character of Perry Mason was portrayed in various Hollywood films of the 1930s and 40s, and a long-running radio program from 1943 to 1955. "When Erle Stanley Gardner was reluctant to allow CBS to transform Mason into a TV soap opera, (CBS) created The Edge of Night. For that latter enterprise, John Larkin, radio's best identified Mason, was cast as the protagonist-star, initially as a detective, eventually as an attorney, in a thinly veiled copy of Mason."
Gardner also created characters for the radio programs The Adventures of Christopher London (1950), starring Glenn Ford, and A Life in Your Hands (1949-1952). "As on other Gardner-inspired narratives, someone else actually penned the scripts."
Eventually Perry Mason became a long-running TV series with Raymond Burr as the title character. Gardner himself made an uncredited appearance as a judge in the final episode of the original series titled "The Case of the Final Fade-Out." In the late 1980s and early 1990s, Mason was revived for a series of made-for-TV movies featuring surviving members of the original cast, including Burr.
Under the pen name A. A. Fair, he also wrote a series of novels about the private detective firm of Bertha Cool and Donald Lam. He also wrote another noteworthy series of novels about District Attorney Doug Selby and his opponent, the rascally Alphonse Baker Carr. This series is interesting in that it is an inversion of the motif of the Perry Mason novels, with prosecutor Selby being portrayed as the courageous and imaginative crime solver and his perennial antagonist A.B. Carr being a wily shyster whose clients are always "as guilty as hell".
The Harry Ransom Humanities Research Center currently archives Gardner's manuscripts. The library has constructed a miniaturized reproduction of his study room.
Gardner held a lifelong fascination with Baja California and his written works became an authority on the early exploration of the Mexican peninsula. He used various modes of transportation to traverse Baja; including boat, oversized trucks, airplane and even helicopter.
In a real murder trial case in Arizona, the district attorney used The Case of the Curious Bride as the basis for his line of questioning. According to the Gardner Mystery Library (Walter J. Black, Inc.): "The Arizona murder trial was going badly for the district attorney. He knew the accused was guilty; but because of a quirk in the law, he had no hope for a conviction. Then, one day, the district attorney called the suspect’s wife to the stand and started an unexpected line of questioning. When the judge demanded an explanation, the district attorney produced The Case of the Curious Bride by Erle Stanley Gardner. In it, he said, Perry Mason used the same questioning. The Judge withdrew to his chambers, and when he returned, he allowed the district attorney to proceed with his ingenious approach. It changed the course of the trial and led to a verdict of 'Guilty.' ”