PoorMansTSqlFormatter is a free and open-source online beautifier, with offline SSMS Add-In, command-line beautifier tool, and Notepad++ plugin.
The project aims to format any T-SQL (2000 or later) script, no matter the length or complexity.
Hope this helps!