Jaswant Singh Chail, 21, pleaded guilty to three charges, including an offence under the Treason Act, during a hearing at the Old Bailey on Friday.
The most serious charge under Section Two of the Treason Act said "on December 25, 2021 at Windsor Castle, near to the person of the Queen, you did wilfully produce or have a loaded crossbow with intent to use the same to injure the person of Her Majesty Queen Elizabeth the Second, or to alarm her Majesty".
He was also charged with making a threat to kill the Queen and having a loaded crossbow, an offensive weapon, in a public place.
The defendant had been detained on Christmas Day, 2021 close to the Queen's private residence, where she was at the time.
Chail, who was unemployed at the time, but previously worked for a branch of the Co-op supermarket, was spotted in the grounds of Windsor Castle about 8:10am.
It is understood he had scaled the perimeter of the grounds with a nylon rope ladder some two hours before.
He was wearing a hood and mask and was carrying a crossbow loaded with a bolt, with the safety catch off and ready to fire.
He told a police protection officer "I am here to kill the Queen", before he was handcuffed and arrested.
Detectives trawled through CCTV and established Chail had travelled to Windsor on December 23, 2021.
The investigation uncovered evidence of his planning and that he had been motivated by ill-feeling towards the British Empire.
Prosecutors allege he sought revenge against the establishment for the treatment of Indians, and had sent a video to about 20 people claiming he was going to attempt to assassinate the Queen.
The video was recorded four days earlier and sent to Chail's contacts list about ten minutes before his arrest.
Chail, who was charged on August 2 last year, had previously applied to join the Ministry of Defence Police and the Grenadier Guards, in a bid to get close to the royal family.
The Supersonic X-Bow weapon he was carrying had the potential to cause "serious or fatal injuries", according to the prosecution.
Chail, from Southampton, Hampshire, entered his guilty pleas before senior judge Mr Justice Jeremy Baker by video link from Broadmoor hospital.
The defendant, who wore a black jacket with fake fur collars, spoke only to confirm his name and to plead guilty to the charges against him.
Prosecutor Alison Morgan KC had asked for the defendant to enter pleas after a psychiatric report found he was fit to stand trial.
She suggested a mental health disposal in the case may not be needed as Chail's condition had improved with treatment at Broadmoor where he had been since February last year.
Mr Justice Baker ordered Chail's treating doctor to compile a report on his "diagnosis, prognosis and if necessary disposal" by the end of February with a further report by another psychiatrist dealing with how dangerous Chail is.
The senior judge fixed a sentencing date at the Old Bailey for March 31.
The judge also lifted a court restriction in the case allowing details to be reported.
Nick Price, head of the Crown Prosecution Service Special Crime and Counter Terrorism Division, said: "Chail entered the protected areas within Windsor Castle after making threats to kill Her late Majesty Queen Elizabeth II. Thankfully police officers intervened and nobody was hurt.
"This was a serious incident, but fortunately a rare one. We are grateful to all those who were involved in the investigation."
Commander Richard Smith, who leads the Met's Counter Terrorism Command, said: "This was an extremely serious incident, but one which the patrolling officers who apprehended Chail managed with great composure and professionalism.
"They showed tremendous bravery to confront a masked man who was armed with a loaded crossbow, and then detain him without anyone coming to harm.
"Our Royalty and Specialist Protection Command works with the Royal Household and local police forces at various Royal Residences across the country to ensure those living, working or visiting are kept safe."
The CPS confirmed the late Queen and other members of the royal family had been at Windsor Castle when Chail was intercepted and ordered to drop the weapon.
Based on subsequent tests, the bow was found to be comparable to a powerful air rifle with the potential to cause serious or fatal injury.
Crossbow bolts, a metal file and other items were later found in a hotel room where Chail had stayed the previous night, the CPS said.
The allegations against Chail were not being treated as a terrorism offence but had been dealt with by the Counter-Terrorism Division.
In 1981, Marcus Sarjeant was jailed for five years after pleading guilty under the 1842 Treason Act, which makes it an offence to assault the Queen, or have a firearm or offensive weapon in her presence with intent to injure or alarm her or to cause a breach of peace.
He had fired blank shots at the Queen while she was riding down The Mall in London during the Trooping the Colour parade in 1981.