I am looking for way (preferably and online site) to a reverse Uglify of some javascript. The Website: http://jsbeautifier.org/ is great for minifed code, but it is does not do a great job for ugly stuff.
-
Would minifying the code, then beautifying it work? I'm not sure what you mean by ugly code, unfortunately. – Chris Forrence Aug 23 '13 at 17:31
-
I am talking about reversing this code that was done with this tool: https://github.com/mishoo/UglifyJS – Dr.YSG Aug 25 '13 at 02:27
-
JS Beautifier does a great job with Uglified JS code. Not sure what the problem is? – Chuck Le Butt Jan 12 '14 at 14:04
-
I don't need the answer any more, but If you put this down as answer, I will check it off, I think it will work. – Dr.YSG Jan 13 '14 at 20:05
-
Actually UglifyJS does all sorts of really nasty renaming, transforms of switches, ifs, etc. It is really is a one-way obfuscation of the code. So JS Beautifier does not help. But my solution is to join the development team, so I can get the source code! – Dr.YSG Jan 14 '14 at 15:34
-
[UglifyJS](https://github.com/mishoo/UglifyJS) is a JavaScript parser, minifier, compressor and beautifier toolkit. – Maduka Jayalath Jun 04 '23 at 03:12
3 Answers
There is this awesome online tool, JSNice, that makes a great job of finding names to obfuscated variables.
We make even obfuscated JavaScript code readable. We will rename variables and parameters to names that we learn from thousands of open source projects. Furthermore, often we are also able to guess or infer type annotations.

- 973
- 1
- 11
- 21
-
1
-
This project is no longer maintained but it still appears to be working as of this comment. – jasonleonhard Dec 17 '21 at 00:22
-
Chrome dev tools ability to Pretty Print
All you need to do is to click the { }
icon on the bottom toolbar to activate this feature. Of course, the names will still be obfuscated (depending on what program minfied the JavaScript in the first place), but you will at least be able to set break points and debug the code.
Source: Tip #2 in this archived article.

- 5,031
- 17
- 33
- 41

- 727
- 4
- 14
-
6I tried this, but it is the same "unminify" as jsbeutifier.org, and uglyfy does really nasty things: boolean short circuits instead of if, then, else, replace all semi-colons with commas, and other ugly things that go beyond minifying. – Dr.YSG Aug 26 '13 at 16:12
Depends on what options you used when you uglify your code. If you just remove the line breaks, then Chrome dev tools will be able to do a great work as sirinivas explained. But if you mangle the code, then there is no way you can get the exact previous code. (in uglifying var logngvariable = a + b;
becomes var c=a+b;
. there is no way a tool can figure out the previous name logngvariable
)
On the otherhand if you want an un-uglified code you may not uglify it at the first place... :)

- 1,446
- 21
- 31

- 1,426
- 2
- 19
- 31