Scotland’s biggest health board, NHS Greater Glasgow and Clyde, topped the league table, spending £8.8 million on nursing and midwifery overtime in 2016-17.
NHS Grampian came second, paying out £3.7 million, followed by NHS Tayside and NHS Lanarkshire both at £2.8 million.
The ongoing crisis of staff shortages in hospitals across the country is costing the NHS an additional £500,000 a week.
Health boards are experiencing significant staff shortages, and nursing vacancies reached a record high last year.
Miles Briggs, Scottish Conservative shadow health secretary, said the figures highlighted the Scottish Government’s lack of planning in providing adequate staffing levels.
“Nurses already have a tough job without being roped in for overtime, and they should be commended for going the extra mile.
“But the sheer scale of the cost here exposes just how badly the SNP has planned the NHS workforce over recent years.
“It shouldn’t have been a surprise that Scotland’s population has increased and aged, yet the SNP government was caught flat-footed.
Mr Briggs added: “Now health boards are having to shell out tens of millions in overtime payments just to plug the gaps.
“The SNP cannot blame anyone else for this. It is in sole charge of health, has been for more than a decade, and should have solved this problem long before now.”
While the figures – obtained by the Scottish Conservatives through Freedom of Information - show a slight reduction from last year, they are still significantly higher than in 2014-15 when overtime cost £21.7 million.
Last year (2015-2016), health boards paid out £27,109,290 in overtime payments.
Anas Sarwar, Scottish Labour shadow cabinet secretary for health, said there were serious gaps in provision despite the use of overtime and agency staff.
”Under the SNP we have a workforce crisis in our hospitals. Staff are overworked and underpaid as a result of years of pay restraint there are huge gaps in key professions.
“These figures should be viewed within the context of soaring private agency spending in the health service as well.
“Only Labour has a plan to fix this crisis, with our workforce commission consulting with trade unions, staff and other expert groups to develop a blueprint to staff our health service properly in the future.”
Norman Provan, Royal College of Nursing Scotland, said: “In the last 12 months we have seen record levels of nursing and midwifery vacancies across the NHS in Scotland. The high vacancy rate is an indication that the Scottish Government and health boards have failed to future proof the workforce and are constantly relying on nurses working additional hours to cover shortages of staff. Without strategic long-term planning and ensuring nursing staff are paid fairly for the work they do, patients won’t get the care they need.
“We will be asking the Scottish Government to ensure their proposed bill on ‘safe and effective staffing in health and social care’ supports improved workforce planning and safeguards patients by guaranteeing the right staff in the right place at the right time.”