She was taken to London’s King Edward VII’s Hospital from Windsor Castle, where she had been resting, on Sunday – her first hospital stay in 10 years.
Buckingham Palace said the Queen, 86, had been admitted as a precaution and was otherwise in “good health“.
All official engagements for this week, including the Queen’s trip to Rome, will be either cancelled or postponed.
News of her illness first emerged on Friday night and she cancelled a trip to Swansea on Saturday to mark St David’s Day in a military ceremony.
However, earlier on Sunday she had carried out a private medal presentation at Windsor Castle.
A spokesman for the Queen said she was in “good spirits”.
“This is a precautionary measure,” he said.
“She was not taken into hospital immediately after feeling the symptoms. This is simply to enable doctors to better assess her.”
The Queen is expected to remain in hospital under observation for about two days.
BBC royal correspondent Nicholas Witchell said there were unlikely to be regular updates issued about her condition, but there was nothing to suggest she would not make a full recovery.
There was no sense of alarm from palace officials about the events, our correspondent added.
The Queen last received treatment 10 years ago, again at the King Edward VII’s hospital. for a minor knee operation. At the same time, surgeons removed minor, non-cancerous lesions from her face.
Gastroenteritis causes inflammation of the stomach lining and intestines.
The infection can be transmitted through contact with an infected person or contaminated food and drink. Symptoms can include vomiting, fever and stomach ache.
The Queen’s treatment, which has not been disclosed, could include rehydration and tests to establish if the illness has been caused by an infection or an underlying problem.
The Queen had been due to spend two days in Rome with the Duke of Edinburgh next weekend, at the invitation of Italy’s President Giorgio Napolitano.
It is not clear whether the visit will be re-scheduled.
A reception at Buckingham Palace on Tuesday for MPs and MEPs will go ahead with other members of the royal family present.