The formation of biofilms on surfaces of indwelling medical devices is a serious medical problem. Staphylococcus epidermidis is a common pathogen found to colonize implanted devices and as a biofilm is more resistant to the host immune system as well as to antibiotic treatments. Combating S. epidermidis infections by preventing or eradicating biofilm formation of the bacterium is therefore a medically important challenge. We report here a study of biofilm formation of S. epidermidis on solid surfaces using a combination of confocal laser scanning (CLSM) and atomic force microscopy (AFM) in both air and aqueous environments. We have investigated the inhibitory effects of surfaces treated with four organic compounds, two benzoate derivatives denoted as compound 59 and 75 and two carboxamide derivatives denoted as compound 47 and 73, on S. epidermidis adhesion and biofilm formation. All four compounds evoke significant inhibitory effects on the formation of S. epidermidis biofilms with compounds 47 and 73 being most effective. None of the compounds were found to inhibit growth of S. epidermidis in liquid cultures. Bacteria attached to the substrate when exposed to the compounds were not affected indicating that these compounds inhibit initial adhesion. These results suggest a pretreatment for medically implanted surfaces that can prevent the biofilm formation and reduce infection.