http://jsbeautifier.org/

It does a wonderful job , especially useful when you want to understand 3rd party obfuscated javascript code