Electrochemical methods can reveal how carrier concentration, surface states and structural defects vary through InP layers. With a suitable electrolyte, depth-resolved measurements can also guide the optimization of thermally diffused p+n and n+p junctions.