An electrochemical etching technique has been developed that provides continuous control over the porosity of a porous silicon (PSi) layer as a function of etching depth. Thin films with engineered porosity gradients, and thus a controllable refractive index gradient, have been used to demonstrate broadband antireflection (AR) properties on silicon wafers and solar cell substrates. This low broadband reflectivity is a direct result of the formation of a refractive index gradient at the substrate surface, where the transition between air and silicon occurs continuously throughout the thickness of a PSi film. These graded index films are formed by applying a continuously changing current function to the electrochemical cell during the PSi etch. The application of these films as solar cell AR coatings is of particular interest, where their broadband nature is a critical advantage. For this application, graded index PSi films must not only offer superior AR properties, but must also prove minimally disruptive to the electrical properties of the underlying solar cell. This requirement limits the total thickness of these films to approximately 120 nm, creating several challenges for this process. However, the simplicity and highly reproducible nature of this technique, in combination with its short duration (less than 10 seconds), make it a strong alternative to current vacuum deposited AR coating technology.