Scrutiny into the latest visitor numbers suggest a £2 a night charge could generate the sum in the busiest month for the Edinburgh festivals.
The analysis, by Scottish Labour, is based on a £2 charge across all accommodation and assumes a 90 per cent occupancy rate expected during August. Edinburgh hotels achieved 83.7 per cent occupancy last year, but that figure traditionally rises to at least 90 per cent across August.
There are an estimated 45,000 beds available for visitors to the city.
Labour shadow cabinet secretary for communities Monica Lennon said: “Scotland’s public services are under increased pressure after the SNP government’s brutal £1.5 billion of austerity cuts to local councils.
“Our local communities are in serious need of additional funding, which means we need to urgently look at new ways for local authorities to raise revenues, including a tourist tax
“Labour analysis suggests that Edinburgh could have raised £2.5m during the festival alone.
“That is money that could be ploughed back into vital local services.
“With Holyrood due to return next week, Labour will press the SNP government to finally give our local councils more economic power to raise additional revenues and protect services.”
Labour would devolve the power to local government to charge the visitor levy on each hotel night per person.
Edinburgh Council, which backs the tourist tax, said support for the policy was growing.
But before it can introduce the new levy the council needs to persuade the Scottish Government to give it the relevant powers.
City council leader Adam McVey said: “It is entirely fair to expect tourists to contribute to the city maintenance, to cultural and tourist investments and to marketing the city, so that it remains globally attractive.”
The council has not yet set out exactly how the money raised would be used.
Short-term accommodation site Airbnb said last week it would be happy to operate a visitor levy, claiming it already has agreements with more than 400 governments and local authorities to collect a tourist tax.