The Employment Appeal Tribunal decision paves the way for possible payouts worth thousands of pounds to workers who do voluntary overtime, according to the Unite union.
But companies warned they face a multibillion-pound bill which could put some out of business, as some voiced fears of cancelled pay rises and redundancies.
The Employment Appeal Tribunal ruled on two cases relating to the UK's interpretation of the Working Time Directive, including one involving electricians, scaffolders and semi-skilled operatives who worked on a project at the West Burton power station site in Nottinghamshire.
Unite said the workers consistently worked overtime, but that was not included in holiday pay, meaning they received "considerably less" pay when on holiday compared to when they were working.
Unite executive director for legal, membership and affiliated services, Howard Beckett said: "Up until now some workers who are required to do overtime have been penalised for taking the time off they are entitled to. This ruling not only secures justice for our members who were short changed, but means employers have got to get their house in order.
"Employers will now have to include overtime in calculating holiday pay, and those that don't should be under no illusion that Unite will fight to ensure that our members receive their full entitlement.
Paul Kenny, general secretary of the GMB union, said: "This win in the Employment Appeal Tribunal clarifies that overtime should be included in the calculation of holiday pay. For many workers, overtime, shift payments, unsociable hours payments and other allowances were excluded when they should be included.
"GMB is asking members who did not get the same pay during holiday as during the rest of the year to contact the union so that we can assess and take forward their claims."
Many celebrated the news on Twitter:
Unite The Union win holiday pay Tribunal. Great News.— Billy Hayes (@BillyHayes_CWU) November 4, 2014
BBC News - Holiday pay ruling may affect millions of workers http://t.co/xmzaZt3taG this could be a great day for the UK!!!— Beth Mate (@beffmate) November 4, 2014
But others feared that the potential backdated bills could lead to redundancies, or cancelled pay rises.
Overtime should count in holiday pay http://t.co/0Vdup3hwkD If this gets backdated & the companies go bust then they'll have no jobs anyway— ☣Stυ ツ (@thew00d) November 4, 2014
Holiday pay issue likely to get very, very messy for employers now: implications for pay rises, pensions and benefits as well— James Hurley (@jameshurley) November 4, 2014
Skeptics branded the worries "hysteria" and said any successfully-won payments would not have much impact.
Hysteria on #BBC over holiday pay ruling, no it won't drive companys out of business or stop people getting pay rises, total bullshit.— Chris Adams (@chrisinsomerset) November 4, 2014
The news came as a study found that long-term shift work can age your brain. Working shifts over a decade makes you lose brain function of an amount equivalent to getting 6.5 years of older, Sky News reported.