Four people have been hospitalised in New South Wales after suspected ecstasy overdoses, police say.

Three men and a woman, all aged between 20 and 22, were taken to hospital overnight after taking the illicit drug, which was obtained at house parties and a licensed premise in the Cronulla area.

Police said the group all ingested a hallucinogenic drug in the form of a small blue pill with a scissor logo stamped on it.

Three of the four have since been discharged, while one of the men remains under observation in hospital.

Police are investigating the origin of the drugs.