Ordered 3D arrays of polyaniline (PANI) inverse opals were fabricated via electrochemical methods by using colloidal crystals of polystyrene beads as sacrificial templates. Compared with films obtained by chemical synthesis, the inverse opaline samples obtained by electrochemistry had a much higher structural quality. To explore potential biosensing applications, PANI composite inverse opals were fabricated for the first time by modifying the structure with different dopants, such as poly(acrylic acid) (PAA) and poly(styrene sulfonate) (PSS). It was found that these dopants had a major effect on the structure of the obtained opaline films. With selection of suitable dopants, PANI composite inverse opals could be fabricated with very high quality. The obtained films remained electroactive in buffer solutions of neutral pH. Owing to their huge surface area, they should be ideal candidates for biosensing applications, e.g., as electrocatalysts or bioreactors. Our first effort to use such macroporous structur...