Firstly, you can't assume that written= formal speech=informal. You can get very formal speech and very informal writing. Idioms are generally considered informal, in speech or in writing.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.