He said he had experienced mild symptoms over the past 24 hours, including a temperature and cough, but would continue to lead the government.
England’s Health Secretary Matt Hancock said he had also tested positive while England’s Chief Medical Officer, Prof Chris Whitty, has shown symptoms.
Another 181 people died with the virus in the past day, figures showed.
It takes the total number of UK deaths to 759, with 14,543 confirmed cases.
The daily coronavirus news conference was led by Cabinet Office minister Michael Gove, alongside deputy chief medical officer Dr Jenny Harries and NHS England chief executive Sir Simon Stevens.
They announced plans to begin a large-scale testing programme of health service staff, starting with critical care teams. It will later be expanded to cover social care staff too.
It follows mounting criticism from NHS staff over a lack of testing – currently, only seriously-ill patients in hospital are being tested.
Testing will be carried out on staff showing possible symptoms of the virus or staff who live with people who have symptoms – not for all frontline workers as a matter of course.
“This will be antigen testing – testing whether people currently have the disease – so that our health and social care workers can have security in the knowledge that they are safe to return to work if their test is negative,” Mr Gove said.
The British Medical Association, which represents doctors, said the announcement was “long overdue” and the lack of testing so far had been “incredibly frustrating”.
“For every healthy member of staff at home self-isolating needlessly when they do not have the virus, the NHS is short of someone who could be providing vital care to patients on the frontline,” BMA chairman Dr Chaand Nagpaul said.
He said that 33,000 beds – the equivalent of 50 hospitals – had been freed up across England ready for coronavirus patients.
The government has imposed strict restrictions on everyday life designed to slow the spread of the virus.
Mr Gove said scientific analysis suggested the rate of infection had been doubling every three to four days, but the “fantastic” public response to the restrictions would make a difference.
Asked whether the prime minister and health secretary should have been “better protected”, he said: “The fact that the virus is no respecter of individuals, whoever they are, is one of the reasons why we do need to have strict social distancing measures so that we can reduce the rate of infection and reduce the pressure on the NHS,” he added.
Mr Johnson is thought to be the first world leader to announce they have the virus.
He was last seen on Thursday night, clapping outside No 10 as part of a nationwide gesture to thank NHS staff and carers.
In a video on his Twitter account, Mr Johnson, 55, said: “I’m working from home and self-isolating and that’s entirely the right thing to do.
“But, be in no doubt that I can continue, thanks to the wizardry of modern technology, to communicate with all my top team to lead the national fight-back against coronavirus.”
The PM chaired a phone call on Friday morning, and later in the day, Downing Street said he had spoken to US President Donald Trump.
“The president wished the prime minister a speedy recovery from coronavirus,” a spokesman said. “They agreed to work together closely, along with the G7, the G20, and other international partners, to defeat the coronavirus pandemic.”
Mr Hancock said he was experiencing mild symptoms of the virus, and would be self-isolating until next Thursday.
He told BBC Look East it was “understandable that people will ask the question” why he and the prime minister were tested, but most people with possible symptoms were not.
The health secretary said there was a protocol laid down by the chief medical officer which required a small number of senior figures, key to the national effort, to be tested.