Quantum many-body physics simulations with matrix product states can often be accelerated if the quantum symmetries present in the system are explicitly taken into account. Conventionally, quantum symmetries have to be determined beforehand when constructing the tensors for the matrix product state algorithm. In this work, we present a matrix product state algorithm with an adaptive U (1 ) symmetry. This algorithm can take into account or benefit from U (1 ) or Z2 symmetries when they are present or analyze the nonsymmetric scenario when the symmetries are broken without any external alteration of the code. To give some concrete examples we consider an XYZ model and show the insight that can be gained by (i) searching the ground state and (ii) evolving in time after a symmetry-changing quench. To show the generality of the method, we also consider an interacting bosonic system under the effect of a symmetry-breaking dissipation.