Self-confessed "computer geek" Paul Dixon, from County Durham, disrupted BA's site and others, including Durham Police, in October 2014.
Newcastle Crown Court was told the 24-year-old was caught after he boasted about his crimes on social media.
The court heard disruption to BA's site cost the airline an estimated £100,000.
Unemployed Dixon, from Seaham, was given a suspended two-year jail sentence and ordered to pay £200 after previously admitting five counts of unauthorised modification of computer material.
Sarah Wood, prosecuting, told the court Dixon used Distributed Denial of Service (DDoS) attacks, which swamp a target website with an overwhelming stream of requests for access, causing the site to work very slowly or to shut down completely.
The origin of such attacks is normally hard to trace, Recorder John Aitken was told, but Dixon gave the game away by tweeting about his exploits.
Ms Wood said: "He could not resist boasting about his activities online on his Twitter account.
"Indeed, this appears to be the sole motivation behind his actions."
Dixon did not make any money from the premeditated hacks, the court heard.
He went on hackers' forums and appealed for friends to name targets for him.
The attack on British Airways happened on 26 October and lasted 68 minutes.
Ms Wood added: "While the website was not brought down, the traffic to the website was so great that legitimate customers would not have been able to access it either to make a booking or to check in."
The airline said disruption to the website would have cost it approximately £100,000.
Durham Police investigated and traced Dixon after searching Twitter for messages about the attacks.
Sam Faulks, defending, said Dixon was "not living in the real world" and was at the time "self-obsessed", "puerile" and "fairly isolated".
Recorder Aitken told Dixon his offending was "simply to boost your own ego".
A man who admitted hacking the websites of British Airways and several police forces has been handed a suspended prison term.