The Nocturne in B, Op. 40, (B. 47) is a work in a single movement for string orchestra by Antonín Dvořák, published in 1883.
The work originated as the slow movement, Andante religioso, of Dvořák's early string quartet, No. 4 in E minor, of 1870, which was unpublished in his lifetime. The movement was adapted and included in his String Quintet No. 2 in G, of 1875: it was one of two slow movements, and he later withdrew this movement from the quintet.
The work is in the key of B major, and its duration is about 9 minutes. There is a calm atmosphere throughout. After a simple introduction in octaves, there is a long section, featuring a winding melody over a pedal note of F♯ which gives a sense of anticipation; eventually this gives way to a more animated section. Finally there is a return, without the sense of anticipation, to the original texture.