Arrays of electrodes for recording and stimulating the brain are used throughout clinical medicine and basic neuroscience research, yet are unable to sample large areas of the brain while maintaining high spatial resolution because of the need to individually wire each passive sensor at the electrode-tissue interface. To overcome this constraint, we developed new devices that integrate ultrathin and flexible silicon nanomembrane transistors into the electrode array, enabling new dense arrays of thousands of amplified and multiplexed sensors that are connected using fewer wires. We used this system to record spatial properties of cat brain activity in vivo, including sleep spindles, single-trial visual evoked responses and electrographic seizures. We found that seizures may manifest as recurrent spiral waves that propagate in the neocortex. The developments reported here herald a new generation of diagnostic and therapeutic brain-machine interface devices.