Spatial light modulators (SLMs) are used to diffract light beams for a variety of applications. In particular, optical tweezer trapping has greatly benefited from the advent of phase-mostly and phase-only SLMs to write holograms that produce multiple traps. We are using holographic optical tweezers to trap multiple sensor particles in a lab-on-a-chip measurement platform. As part of this program, we have developed a method for optimizing the diffraction efficiency of a SLM. This general method can be applied in situ and addresses the issues of nonlinear phase modulation and phase modulation less than 2π. The method employs a one-dimensional blazed phase grating written on the SLM. For an ideal SLM, the phase shift is linear and covers 0 - 2π, yielding a first-order diffraction efficiency of unity. For a realistic SLM with nonlinear or reduced phase shift, the efficiency is approximately η = 1 - σ2, where σ2 is the variance of the phase error from the ideal case. Because each pixel contributes to the phase error independently, this suggests a method to maximize the efficiency by adjusting the phase encoding of the SLM pixel-by-pixel. In practice, we do this by adjusting the gray-scale of each pixel while measuring the first-order diffracted power. The collection of optimal gray values comprises the optimized gray-scale lookup table, which exhibits the nonlinearity required to produce a linear phase grating and the saturated phase encoding that maximizes the efficiency of phase limited SLMs. We have successfully applied this optimization method to two different SLMs.