We establish optimal error bounds for time-splitting methods and exponential wave integrators applied to the nonlinear Schrödinger equation (NLSE) with low regularity potential and nonlinearity, including purely bounded potential and locally Lipschitz nonlinearity. While the NLSE with smooth potential and nonlinearity such as the cubic NLSE with harmonic potential (also known as the Gross-Pitaevskii equation) is well-known, some physical applications involve low regularity potential and/or nonlinearity, like square-well potential, disorder potential and non-integer power nonlinearity. Most numerical methods for smooth NLSE can be directly extended to solve the NLSE with low regularity potential and nonlinearity, however, the error estimates of them are subtle and challenging, which require new techniques and in-depth analysis.