Controlled synthesis of macroporous tin photocatalyst with a SnOx surface layer (SnOx@P-Sn) was achieved via chemical dealloying then thermal oxidation. The microstructure of macroporous Sn was inherited from the immiscible Sn30Zn70 precursor. The chemical composition of surface SnOx and the concentration of oxygen vacancies on the Sn ligaments is dependent on the thermal oxidation temperature, with p-SnO/n-SnO2 heterojunctions being formed at 500°C. The obtained SnOx@P-Sn@500°C p-n heterojunction surface layer achieved an outstanding degradation efficiency of 96.7 % when used to catalyze the photodegradation of methyl orange azo dyes (MO). The Langmuir-Hinshelwood Kinetics model was modified to describe the photodegradation process with higher coefficient of determination. The reason for the superior degradation reaction rates of SnOx@P-Sn@500°C p-n heterojunction photocatalyst includes: large specific surface area of the Sn substrates, appropriate band gap formed via thermal oxidation, higher oxygen vacancies, and efficient separation of electron/hole pairs in the p-SnO/n-SnO2 heterojunction.