We report on the development of an etching setup for use in the preparation of platinum/iridium tips for atomic force microscopy and scanning electrostatic force microscopy as well as scanning tunneling microscopy. The etching process is based on a two step electrochemical procedure. The first step is a coarse alternating current (ac) etching in which the etching is continuous and stops automatically when the lower part of the wire drops off, while the second step is a fine etching made by a number of ac pulses, each of a certain duration and separated by a certain interval of time. When the tip material being etched is platinum/iridium (10%) the influence of the stop phase of the ac current terminating each pulse in the second etching is found to be negligible, while in the case of second etching of tungsten wires it is important to break the pulse in a certain phase to avoid formation of a thick oxide layer. In order to explain the relatively high etching rates observed for the otherwise noble metal platinum we suggest that besides anodic corrosion of the platinum by the electrolyte containing chloride ions, a different etching mechanism causes a substantial increase of the etching rate. This mechanism is based on the formation of oxygen and hydrogen at the platinum/iridium electrode when the potential is above the dissociation potential of water (~ 1.23 V) and storage of these products interstitially in the outer layers of the platinum wire. This leads to "microexplosions" that detach fragments of platinum from the wire surface and hereby give rise to "etching" of the wire. In the second etching blunt tips become sharp while tips which are already sharp apparently stay sharp. Therefore, the second etching scheme with pulses separated by pauses is found to be a very important factor for the production of sharp tips. After being etched the tips are ready for use in scanning tunneling microscopes, or they may be bent to form integrated tip/cantilever systems in ordinary commercial atomic force microscopes, being applicable as tapping mode tips and as electrostatic force microscopy tips. ©1999 American Institute of Physics.