The standard grips this chord is usually shown with.
B is B, D# and F#, a major triad. The shape this page opens on is written x24442, lowest string first.
Note by note. B is the root, D# is the major third and F# is the fifth.

Also written Bmaj, BM or B major. The same chord either way; which spelling you meet depends on who wrote the chart.
There are 6 common shapes for B on the guitar, and 44 derived voicings in the triad family.
One note away. Change a single note of B and you have Bm (with one note moved), Bsus2 (with one note moved), Bsus4 (with one note moved), Bmaj7 (with one note added), Badd9 (with one note added) or B5 (with one note taken away).
In which keys. Every note of B belongs to C# minor (the ♭VII), Eb minor (the ♭VI), E major (the V), F# major (the IV), Ab minor (the ♭III) and B major (the I).
The common shapes, written lowest string first: x24442, 764447, xx4447, 799877, x-x-9-11-12-11, x-14-13-11-12-11.
Under the hand. None of the shapes for B uses an open string, so every one of them is movable; the lowest sits at the 2nd fret. 4 of the 6 need a barre. Together they cover the neck from the 2nd fret to the 14th.
Triad. Three notes across one string set. B has 221xxx, xxx442, x2444x, xx4442, x644xx, xx444x, x6444x, xx987x.
What kind of chord this is. B is a major chord — root, major third, fifth. major chords on every root, and what they are for.
The common shapes and the derived voicings come from different places, and both are explained in where the chords and the theory come from.
Shows each chord the way this style would voice it, and marks which of its alternatives belong to the idiom.