The British Library will soon be able to store web pages and e-mails in its archive after a legal change.
The library already holds 51 million printed journals
The library had pushed for electronic items to be included because of the rise in web-based publishing.
"This new legislation will now mean that a vital part of the nation's published heritage will be safe," said MP Chris Mole, who supported the move.
The archive will comprise selective "harvesting" from the 2.9 million sites that have "uk" suffixes.
The new law was given royal assent on Friday.
The library is one of six legal deposit archives which hold a copy of everything published in the UK since 1911.
Other archives are held at the national libraries of Scotland and Wales and libraries at the universities of Oxford, Cambridge and Trinity, Dublin.
The new formats - which also include CD-Roms - will join these archives, and be available for future study.
Under the new law, proposed in a Private Member's Bill, future mediums will also be able to be stored as they are developed.
The law follows a voluntary system that has been used since 2000.
The number of journals published electronically in the UK is expected to jump from 52,000 in 2002 to 193,000 in 2005.
The deposit libraries already hold more than 51 million printed items.