Edit:
The below answer is valid if you don't have a source map (common in production environments). If you have a source map you can refer the @AliKazemkhanolo answer
Answer:
You can't unminify a minified file. Minification is a destructive operation and involves loss of information.
For example, if you have a function with a descriptive name, after minifcation that name will be substituted with a meaningless one. There's no way to go back from this operation.
You can use a beautifier to make it more readable, but you will have a weighty job of reverse engineering in order to understand what the code means.
Answer from Christian Vincenzo Traina on Stack OverflowEdit:
The below answer is valid if you don't have a source map (common in production environments). If you have a source map you can refer the @AliKazemkhanolo answer
Answer:
You can't unminify a minified file. Minification is a destructive operation and involves loss of information.
For example, if you have a function with a descriptive name, after minifcation that name will be substituted with a meaningless one. There's no way to go back from this operation.
You can use a beautifier to make it more readable, but you will have a weighty job of reverse engineering in order to understand what the code means.
source-maps are what you want. in the process of making a minified js file, you should get a source-map file, too (it depends on what tool you use for minification).
Then using source-map library you can recover the original files.
If the source-map file does include the minified source, this file is enough to unminify. otherwise, you have to tell the library the minified source manually.
More info, on the library's Github page.
You can use this : http://jsbeautifier.org/ But it depends on the minify method you are using, this one only formats the code, it doesn't change variable names, nor uncompress base62 encoding.
edit: in fact it can unpack "packed" scripts (packed with Dean Edward's packer : http://dean.edwards.name/packer/)
Chrome developer tools has this feature built-in. Bring up the developer tools (pressing F12 is one way), in the Sources tab, the bottom left bar has a set of icons. The "{}" icon is "Pretty print" and does this conversion on demand.
UPDATE: IE9 "F12 developer tools" also has a "Format JavaScript" feature in the Script tab under the Tools icon there. (see Tip #4 in F12 The best kept web debugging secret)
