The B40 is a cross-country B-road in south County Londonderry.
The road starts on the B74 (former A6) at Feeny and heads southeast through the village before having to give way to cross the B44. The road continues across the Sperrin Mountains, with quite steep hills in places, before descending to Moneymeaney. On the far side of the village the B40 TOTSOs left, with the B162 continuing ahead.
The B40 then continues southeastwards to Draperstown and reaches a roundabout in the village centre, where it meets the B47 and B41. The road then continues across a few miles of fields, with some of the mountains still visible, to reach a T-junction on the A29.
There is a multiplex south for over half a mile through Desertmartin before the B40 regains its number and continues southeastwards. The road soon detours to the north to avoid the steep Mullaghboy Hill and enters Magherafelt whilst on this detour. The B42 is met at a mini-roundabout a short distance before a roundabout, after which we run into the town centre along Rainey Street to reach a roundabout.
Originally the B40 ended here where it met the B160 (shown on some maps as the B181} and A31. However, the latter road was moved onto the Magherafelt bypass in October 2016 and the B40 was extended in both directions of the old road. To the right, Moneymore Road is followed through town before the A31 is met at a roundabout on the edge of open country. To the left we descend the D2 Broad Street then turn right at a mini-roundabout back onto an S2 road, which becomes the dead-straight Castledawson Road. We leave town past playing fields and an industrial estate then cross open country to journey's end at the northern end of the A31 Magherafelt bypass. Here we also meet the A6 Castledawson bypass and the A54 continues ahead into that village.
The Roads (Classification) Order (Northern Ireland) 2017 - This Order provides for the classification of a newly constructed or realigned road (Magherafelt bypass) as specified in Schedule 1 and for the re-classification of the length of road specified in Schedule 2 which has, in consequence, been superseded as a main traffic route.