Anybody who refuses the Big Brother demand could face arrest and a possible prison sentence.
The new rules come in legislation unveiled in today's Queen's Speech.
They are presented as a crackdown on illegal immigration, but lawyers say they could be applied to anybody who has ever been outside the UK, even on holiday.
The civil rights group Liberty, which analysed clauses from the new Immigration and Citizenship Bill, called them an attempt to introduce compulsory ID cards by the back door.
The move would effectively take Britain back to the Second World War, when people were stopped and asked to 'show their papers'.
Liberty said: 'Powers to examine identity documents, previously thought to apply only at ports of entry, will be extended to criminalise anyone in Britain who has ever left the country and fails to produce identity papers upon demand.
'We believe that the catch-all remit of this power is disproportionate and that its enactment would not only damage community relations but represent a fundamental shift in the relationship between the State and those present in the UK.'
One broadly-drafted clause would permit checks on anyone who has ever entered the UK - whether recently or years earlier.
Officials, who could be police or immigration officers, will be able to stop anyone to establish if they need permission to be here, if they have it, and whether it should be cancelled.
No reasonable cause or suspicion is required, and checks can be carried out 'in country' - not just at borders.
The law would apply to British citizens and foreign nationals, according to Liberty's lawyers. The only people who would be exempt are the tiny minority who have never been abroad on holiday or business.
A second clause says that people who are stopped 'must produce a valid identity document if required to do so by the Secretary of State'. Failure to do so would be a criminal offence with a maximum penalty of 51 weeks in jail or a £5,000 fine.
Currently, police are allowed to ask for identity documents only if there is a reasonable suspicion that a person has committed an offence.
During the Second World War, ID cards were seen as a way of protecting the nation from Nazi spies, but in 1952 Winston Churchill's government decided they were not needed in peacetime.
They were thought to be hindering the police because so many people resented being asked to produce them.
Liberty director Shami Chakrabarti said last night: ' Sneaking in compulsory identity cards via the back door of immigration law is a cynical escalation of this expensive and intrusive scheme.'
Tory spokesman Damian Green said: 'This scheme will do nothing to improve our security, may make it worse, and will certainly land the taxpayer with a multi-million bill.
'Labour should concentrate on things that will improve our security, like a dedicated border police force.'