HMS Queen Elizabeth and its sister ship HMS Prince of Wales are the most expensive in the Royal Navy's history.
The navy initially estimated both ships would cost £3.5bn to build but the total figure was revised to £6.2bn.
About 3,700 guests attended the event, which came more than three years after the vessel's official naming ceremony in Rosyth when the Queen broke a bottle of whisky on its hull.
During the ceremony, the commissioning warrant was read, and the Blue Ensign, which has been flying from the ship until it is formally handed over to the Royal Navy, was replaced with the White Ensign, raised by 20-year-old Able Seaman Ellie Smith from Hull.
Addressing the assembled guests and ship's company, The Queen described the ship as "the most powerful and capable ship ever to raise the White Ensign".
"At the forefront of these responsibilities will be the men and women of the Royal Navy, the Royal Marines, supported by the Army, Royal Air Force and by coalition partners.
"As the daughter, wife and mother of naval officers, I recognise the unique demands our nation asks of you and I will always value my special ink to HMS Queen Elizabeth, her ship's company and their families," she said.
Admiral Sir Philip Jones, said: "We have been on a long, complicated - but committed - journey to get to this point and commissioning the ship is a key milestone.
"The point of the big grey ship is it's enormously big, flexible, capable and adaptable."
As part of the ceremony, a 8ft-long (2.44m) cake replica of the ship was cut. As is traditional, it was carried out by the youngest member of the ship's company - Callum Hui, 17 - and the captain's wife Dr Karen Kyd.
Capt Jerry Kyd called the ceremony the "culmination of a number of years of real excitement".
He said: "The first sailing from Rosyth was only nine months ago, we have come a long way.
"The first entry into Portsmouth was in the summer and here we are today accepting the ship into Her Majesty's fleet formally.
"So, it is right at the top, it is the latest milestone, many more to come, but hugely exciting and a very proud day."
The 900ft-long (280m) carrier cannot currently deploy planes but F-35B Lightning fighter jets are due to make their first trial flights from the carrier's deck next year, with 120 air crew currently training in the US.
Preparations for the arrival of the flagship of the fleet and its 700-strong company led to more than 20,000 items, ranging from a human skull to sea mines, dredged up from Portsmouth Harbour.
The Ministry of Defence said specialist dredging vessels had removed 3.2 million cubic metres of sediment - equivalent to 1,280 Olympic swimming pools - during the dredging operation carried out to deepen the harbour mouth to enable the Queen Elizabeth to reach Portsmouth naval base.
Source (BBC): http://www.bbc.co.uk/news/uk-england-hampshire-42256046