A material flow analysis (MFA) method was employed to investigate elemental flow direction during the anaerobic digestion (AD) of wheat straw (WS) pretreated with potassium hydroxide. A lab-scale batch AD experiment conducted at 35 ± 1 °C was investigated to realize carbon conversion in biogas, liquid and solid digestates. The results showed that the highest growth rate of carbon conversion in biogas was observed from the fourth day to the twenty-fourth day, which accounted for 70.64%. The cumulative biogas production of WS was 531 mL g−1 VS, along with a high volatile solids degradation rate (55.0%). The MFA results indicated that the flow mass fractions of carbon in biogas, liquid and solid digestates were 49.96%, 5.61% and 44.43%, respectively. The flow mass fraction of nitrogen in liquid and solid digestates was 45.65% and 54.35%, respectively. This study can provide a theoretical basis for elemental flow in each product from biogas projects.