The incident happened at the two-storey Palletways warehouse in Livingston, West Lothian, shortly after 8am today.
The chemical involved was understood to be denatonium benzoate, which is included in products such as shampoos and liquid soaps.
Lothian and Borders Fire and Rescue Service said 23 people were taken to the town's St John's hospital after complaining of breathlessness and throat irritation.
Firefighters were called to the scene in MacIntosh Road at 8.08am.
The spillage happened as the chemical was being moved on a forklift truck.
Fire crews evacuated the building before making the area safe and clearing the chemical.
About 20 firefighters wearing breathing equipment and chemical suits were involved in the two-hour operation.
The fire service said the spill was "small" and that 23 people had complained of breathlessness and throat irritation. The casualties are understood to be workers at the warehouse.
They were checked over by ambulance crews at the scene and taken to St John's casualty department for check-ups.
A fire service spokeswoman said: "More than 20 firefighters were called to a chemical spill at Palletways warehouse in Livingston, West Lothian, shortly after 8am this morning.
"A small spillage of non-toxic chemical occurred at the business in Simpson Parkway, near MacIntosh Road, Kirkton, Livingston.
"The building was evacuated by fire crews and 23 people were checked over at the scene by ambulance crews before being taken to St John's Hospital in Livingston for a check-up after the incident.
"The casualties were complaining of throat irritation and mild breathlessness.
"Firefighters using breathing apparatus and wearing gas-tight chemical suits dealt with the spillage and made the area safe.
"A total of six fire and specialist appliances were sent out to the scene with the incident concluded just after 10am."
Denatonium benzoate, often known as Bitrex, is a foul-tasting substance used in toxic household products, such as bleach or anti-freeze, to make them taste bitter and prevent accidental ingestion.
Dr Alison McCallum, director of public health and health policy at NHS Lothian, said: "NHS Lothian was alerted to the non-toxic chemical spill and appropriate action plans were immediately activated at St John's Hospital to deal with any casualties.
"The chemical involved, denatonium benzoate, was quickly identified as non-toxic and, therefore, there was no risk to the wider community.
"A total of 23 people were identified as having minor symptoms and they were assessed and treated in the accident and emergency department in St John's.
"There is no impact on the services at St John's, which continue to run normally."