We present a finite-element method to calculate 3-D surface profiles of refractive microlenses fabricated by melting-resist technology (reflow technique). The geometry of the microlenses can be arbitrary. Surface tension and gravity are taken into account. Gravity can have an advantageous influence on the profile form, so that smaller focal spots can be achieved. A simple scaling law is given to estimate the influence of gravity on the profile form for given microlens parameters. We compared various theoretical and measured surface profiles of microlenses fabricated by melting-resist technology and found good agreement. Finally, the usefulness of this method for the design of refractive microstructures for smart masks is shown. © 2000 Society of Photo-Optical Instrumentation Engineers.