The link between drug‐metabolizing enzymes and gut microbiota is well established. In particular, hepatic cytochrome P450 (CYP) 3A activities are presumed to be affected by gut microbiota. However, there is no direct evidence that the gut microbiota affects CYP3A metabolism or the clearance of clinically relevant drugs in vivo. Our purpose was to evaluate the effects of gut microbiota on in vitro and in vivo drug metabolism and on the clearance of midazolam, which is a standard CYP3A metabolized drug. Hepatic Cyp3a activity and in vitro midazolam hydroxylase activity were compared using specific pathogen‐free (SPF) and germ‐free (GF) mice. In a pharmacokinetics (PK) study, SPF and GF mice were intraperitoneally injected with 60 mg/kg of midazolam, and plasma and tissue concentrations were measured. Hepatic Cyp3a activity and midazolam hydroxylase activity were significantly lower in GF mice than in SPF mice. Notably, in the PK study, the area under the plasma concentration–time curve from time zero to infinity and the elimination half‐life were approximately four‐fold higher in GF mice compared with SPF mice. Furthermore, the concentration of midazolam in the brain 180 min after administration was about 14‐fold higher in GF mice compared with SPF mice. Together, our results demonstrated that the gut microbiota altered the metabolic ability of Cyp3a and the tissue accumulation of midazolam.