Keir Starmer has released his tax returns for the last two years, showing that he earned little outside his parliamentary income except for a windfall when his sister sold the family home that he helped her buy. The Labour leader released a summary of his past two years of tax payments on Thursday, a day after the prime minister, Rishi Sunak, released three years of his. But whereas Sunak’s summary showed that he earned millions from a US-based investment fund, Starmer’s income came almost entirely from his salary as an MP and leader of the opposition. Over the two years, Starmer earned a total of almost £275,000, just under £22,000 of which came from legal fees in 2020-21 and £543 from book royalties in 2021-22. He also gained just under £100,000 when his sister sold a property that he had helped her buy for her family to live in. In total, he paid £118,580 in income tax and capital gains tax on these earnings. The Labour leader also announced on Thursday that he would give up the tax-exempt status he enjoys on contributions to his pension from his time as director of public prosecutions. Starmer had been accused of hypocrisy for taking advantage of the special status of the DPP pension while also promising to tax others who contribute more than £1m to their pension pot over a lifetime. But he said on Thursday he would forgo his tax exemption if he were elected prime minister at the next election, saying: “I’m very happy to be – and will be – in the same position as everybody else in this country.” Tom McPhail, a pensions expert at the financial consultancy the Lang Cat, said Starmer’s decision could cost him tens of thousands of pounds before his retirement in extra tax payments. Meanwhile, the Guardian revealed that Sunak had benefited from more than £300,000 in tax savings over the past three years as a result of a capital gains tax (CGT) cut that his party introduced in 2016, for which he voted and spoke in favour. The Conservative government cut the top rate of CGT from 28% to 20% that year, which Sunak welcomed, saying it would help boost investment in British business. The tax records released on Wednesday show that he benefited heavily from that decision, given how much of his earnings came from capital gains on a US-based investment fund. The fund gave him a taxable gain of £1.6m in 2021-22 and a total of £3.8m over three years, the records show. A No 10 source said: “The tax return shows that a considerable amount of capital gains tax is being paid.” But Starmer said Sunak’s returns highlighted the unfairness of the UK tax regime, where capital gains are taxed at a much lower rate than income. “There’s a wider point about choices here,” he said. “The choices they’ve made on tax and the tax system are obvious. They always go after working people – just look at the last 12 months.” • This article was amended on 24 March 2023. An earlier version said that Keir Starmer earned a total of almost £275,000, with just under £22,000 coming from book royalties in 2020-21. This should have said that just under £22,000 came from legal fees in 2020-21 and £543 from book royalties in 2021-22.