We obtain sets of infinite number of conserved nonlocal charges of strings in a flat space and pp-wave backgrounds, and compare them before and after T-duality transformation. In the flat background the set of nonlocal charges is the same before and after the T-duality transformation with interchanging odd and even-order charges. In the IIB pp-wave background an infinite number of nonlocal charges are independent, contrast to that in a flat background only the zero-th and first order charges are independent. In the IIA pp-wave background, which is the T-dualized compactified IIB pp-wave background, the zero-th order charges are included as a part of the set of nonlocal charges in the IIB background. To make this correspondence complete a variable conjugate to the winding number is introduced as a Lagrange multiplier in the IIB action a la Buscher's transformation.