Based on a sample of 1.31×109 J/ψ events collected with the BESIII detector, the matrix elements for the decays η′→ηπ+π- and η′→ηπ0π0 are determined using 351,016 η′→(η→γγ)π+π- and 56,249 η′→(η→γγ)π0π0 events with background levels less than 1%. Two commonly used representations are used to describe the Dalitz plot density. We find that an assumption of a linear amplitude does not describe the data well. A small deviation of the obtained matrix elements between η′→ηπ+π- and η′→ηπ0π0 is probably caused by the mass difference between charged and neutral pions or radiative corrections. No cusp structure in η′→ηπ0π0 is observed.