A classical result of harmonic analysis asserts that if a weight w satisfies Muckenhoupt's condition A(infinity), then the unweighted class BMO is contained in the weighted space BMO(w). The paper identifies the norm of this embedding in the one-dimensional setting. Specifically, for any function f is an element of BMO(R) and any weight w is an element of A(infinity)(R) of characteristic [w](A infinity), we have the estimate parallel to f parallel to(BMO(w)) <= e root 2[w](A infinity) parallel to f parallel to(BMO). The constant e root 2 = 3.8442... is the best possible. We also prove a sharp version of this result in which the characteristic [w](A infinity) of the weight is fixed. Further extensions to the theory of martingales are obtained.