Councillors have backed plans for the Transient Visitor Levy (TVL), which will see an extra £2-a-night charge added to the cost of a room.
But the plans are subject to approval from the Scottish Parliament, which will need to pass enabling legislation.
Edinburgh City Council estimates £14.6m would be raised by the tax every year and invested in infrastructure to help the city cope with its visitor numbers.
The £2 tax will apply to all accommodation types, including short term lets, but campsites will be exempt.
It will be capped at seven consecutive nights, in a move designed to protect seasonal and festival workers for staying in the city for an extended time.
But it has faced opposition from the tourism and hospitality industry, with trade body UKHospitality criticising the tax as “ill-informed and badly conceived”.
The Scottish Tourism Alliance (STA) says occupancy in Edinburgh hotels has fallen this year, and it is concerned a tax could put the city at a further competitive disadvantage.
‘Tourist taxes’ are already used in cities such as Berlin, Paris and Barcelona, but the majority of European countries are also subject to a lower rate of tourism VAT than the UK’s 20%.
The prospect of a TVL in Edinburgh has been debated at a national and local level for over a decade.
Bath is also considering introducing a similar £1 a night tax, and councillors in Aberdeen and Liverpool have also expressed interest in the idea.