It isn't illegal but it will count against you in court.
A jury will consider all the facts and circumstances of a case when deciding whether the prosecution has proved that the defendant was not acting in self-defence. Keeping an offensive weapon or equivalent in an inappropriate location - e.g. a baseball bat beside your bed - and arming yourself with it before going downstairs will go some way to helping the prosecution prove that you confronted the intruder with the intention of attacking them.
If you found an intruder in your garage and grabbed the axe that was in the pile of tools, you'd be on safer ground.
Anyway, the usual points that should be made in any OCUK debate about self-defence:
The number of residents killed in their homes by strangers during the course of a burglary each year is extremely small. Worry about something else.
Professional and prolific burglars have no interest in the massively increased sentences that are doled out for using violence during a burglary. They will run when disturbed; escalating the situation to an armed confrontation is stupid.
Residents are only prosecuted for clearly exceeding the limits of self-defence or taking revenge. If you don't shoot a burglar in the back, chase them down the street before smashing a cricket bat over their head or tie them up before setting them on fire (all real examples), you are very unlikely to be prosecuted.
If you do carry something about in public, you are far more likely to end up in court for possession of an offensive weapon than you are to have cause to use it to defend yourself.