We demonstrate the electrochemical etching of gold in a solution of hydrofluoric acid and dimethylformamide (DMF) to fabricate nanoporous gold (NpAu) films. Compared to de-alloyed NpAu, the electrochemically etched NpAu exhibits controllable pore size and etching depth by adjusting the etching conditions. We propose an etching mechanism where the organic electrolyte DMF protects the nascent gold pore walls by slowing the dissolution of gold oxide. At the same time, localized reactions occurring at the gold electrode surface focus the etching current for etching into depth. We further modify the as-prepared NpAu surface with single walled carbon nanotubes (SWCNTs) and use the nanotube-decorated surface as an electrochemical sensor to detect bisphenol A, an endocrine disruptor chemical. A 100 nM limit of detection is achieved by combining the catalytic capacity of SWCNTs with the specific surface area of a NpAu electrode.