One more very simple solution: use notepad++. Inside there is very good plugin called Poor man's sql formatter. The drawback is that you have to paste SQL
inside the notepad++
. But it is free.
There is also a web pagepoorsql.com, but I did not try it.