We develop a general theory of canonical bases for quantum symmetric pairs (U, U^i) with parameters of arbitrary finite type. We construct new canonical bases for the simple integrable U-modules and their tensor products regarded as U^i-modules. We also construct a canonical basis for the modified form of the i-quantum group U^i. To that end, we establish several new structural results on quantum symmetric pairs, such as bilinear forms, braid group actions, integral forms, Levi subalgebras (of real rank one), and integrality of the intertwiners.