From Wikipedia "
The idea of a fighter development of the Beaufort was suggested to the Air Ministry by Bristol. The suggestion coincided with the delays in the development and production of the Westland Whirlwind cannon-armed twin-engine fighter. Since the "Beaufort Cannon Fighter" was a conversion of an existing design, development and production could be expected far more quickly than with a completely fresh design. Accordingly, the Air Ministry produced Specification F.11/37 written around Bristol's suggestion for an "interim" aircraft pending proper introduction of the Whirlwind. Bristol started building a prototype by taking a part-built Beaufort out of the production line. The prototype first flew on 17 July 1939, a little more than eight months after the design had started, possibly due to the use of much of the Beaufort's design and parts. A production contract for 300 machines had already been placed two weeks before the prototype F.17/39 even flew.
In general, the differences between the Beaufort and Beaufighter were minor. The wings, control surfaces, retractable landing gear and aft section of the fuselage were identical to those of the Beaufort, while the wing centre section was similar apart from certain fittings. The bomb bay was omitted, and four forward-firing 20 mm Hispano Mk III cannons were mounted in the lower fuselage area. These were initially fed from 60-round drums, requiring the radar operator to change the ammunition drums manually — an arduous and unpopular task, especially at night and while chasing a bomber. As a result, they were soon replaced by a belt-feed system. The cannons were supplemented by six .303 in (7.7 mm) Browning machineguns in the wings (four starboard, two port, the asymmetry caused by the port mounting of the landing light). This was one of the heavier, if not the heaviest, fighter armament of its time. When Beaufighter were developed as fighter-torpedo bombers, they used their firepower (often the machine-guns were removed anyway) to suppress flak fire and hit enemy ships, especially escort and small vessels. The areas for the rear gunner and bomb-aimer were removed, leaving only the pilot in a fighter-type cockpit. The navigator/radar operator sat to the rear under a small Perspex bubble where the Beaufort's dorsal turret had been.
The Bristol Taurus engines of the Beaufort were not powerful enough for a fighter and were replaced by the more powerful Bristol Hercules. The extra power presented problems with vibration; in the final design they were mounted on longer, more flexible struts, which stuck out from the front of the wings. This moved the centre of gravity (CoG) forward, a bad thing for an aircraft design. It was moved back by shortening the nose, as no space was needed for a bomb aimer in a fighter. This put most of the fuselage behind the wing, and moved the CoG back where it should be. With the engine cowlings and propellers now further forward than the tip of the nose, the Beaufighter had a characteristically stubby appearance.
Production of the Beaufort in Australia, and the highly successful use of British-made Beaufighters by the Royal Australian Air Force, led to Beaufighters being built by the Australian Department of Aircraft Production (DAP) from 1944 onwards. The DAP's variant was an attack/torpedo bomber known as the Mark 21: design changes included Hercules VII or XVIII engines and some minor changes in armament.