Skip to content

Unminify

Bundlers and obfuscators commonly minify code (remove new lines and whitespace, replace variable names with shorter ones, use a shorter syntax).

Most unminify sites just format the code, but webcrack also converts the syntax back to make it more readable and similar to the original code:

block-statement

js
if (a) b(); 
if (a) { 
  b();  
} 

computed-properties

js
console["log"](a); 
console.log(a); 

infinity

js
1 / 0
Infinity

json-parse

js
JSON.parse("[1,2,3]") 
[1, 2, 3] 

logical-to-if

js
x && y && z(); 
if (x && y) { 
  z(); 
} 
js
x || y || z(); 
if (!(x || y)) { 
  z(); 
} 

merge-else-if

js
if (x) {
} else {  
  if (y) {}  
}  

if (x) {
} else if (y) {} 

merge-strings

js
"a" + "b" + "c"
"abc"

number-expressions

js
-0x1021e + -0x7eac8 + 0x17 * 0xac9c
431390

raw-literals

js
'\x61"\u270F\uFE0F\t'
"a\"✏️\t"
js
0x1
1

sequence

js
if (a) b(), c(); 
if (a) { 
  b(); 
  c(); 
} 
js
if (a(), b()) c(); 
a(); 
if (b()) { 
  c(); 
} 
js
return a(), b(), c(); 
a(); 
b(); 
return c(); 
js
for (let key in a = 1, object) {} 
a = 1; 
for (let key in object) {} 
js
for((a(), b());;) {} 
a(); 
b(); 
for(;;) {} 
js
for(; i < 10; a(), b(), i++) {} 
for(; i < 10; i++) { 
  a(); 
  b(); 
} 
js
while (a(), b()) {} 
a(); 
while (b()) {} 
js
t = (o = null, o); 
o = null; 
t = o; 

split-variable-declarations

js
const a = 1, b = 2, c = 3; 
const a = 1; 
const b = 2; 
const c = 3; 

ternary-to-if

js
a ? b() : c(); 
if (a) { 
  b(); 
} else { 
  c(); 
} 
js
return a ? b() : c(); 
if (a) { 
  return b(); 
} else { 
  return c(); 
} 

typeof-undefined

js
typeof a > "u"
typeof a === "undefined"
js
typeof a < "u"
typeof a !== "undefined"

unminify-booleans

js
!0
true
js
!1
false

void-to-undefined

js
void 0
undefined

yoda

https://eslint.org/docs/latest/rules/yoda and https://babeljs.io/docs/en/babel-plugin-minify-flip-comparisons

js
"red" === color 
color === "red"