Reactive ion etching of both Nb and Nb/AlAlOx/Nb trilayer has been optimised for the fabrication of Josephson tunnel junctions. Niobium thin films deposited by magnetron sputtering on silicon wafers have been patterned by a process using CF4+O2. The effect of main process parameters on photoresist mask etch anisotropy has been demonstrated by scanning electron microscopy (SEM) observations, and the influence of gas composition, total pressure and discharge power on etch rates has been evaluated by response surface methodology. A face-centred cubed experimental design with 17 trials has been performed and the data processed using multiple regression analysis. Second-order polynomial expressions (response surfaces) for Nb and Si etch rates as functions of process parameters have been obtained. A reliable and repeatable Nb etch process has been defined in the range 100–270 mTorr total pressure, 50–70 W input power and 0–10% by flow of O2 added to the CF4. Maximum Nb and Si etch rates were obtained with 7% O2 in the gas mixture, and SEM showed that vertical etch profiles were produced at 50 mTorr CF4+5%O2.