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 Overflow
🌐
Unminify
unminify.com
Unminify JS, CSS, HTML, XML and JSON Code
This unminifying tool will take minified code and expand it so it is easier for humans to read. It can do this with files or with copied code snippets. It supports JavaScript (JS, JSX), TypeScript (TS, TSX), CSS (including SCSS, Sass, Less), HTML, XML, and JSON code.
🌐
GitHub
github.com › jehna › humanify
GitHub - jehna/humanify: Deobfuscate Javascript code using ChatGPT
This tool uses large language modeles (like ChatGPT & llama) and other tools to deobfuscate, unminify, transpile, decompile and unpack Javascript code. Note that LLMs don't perform any structural changes – they only provide hints to rename variables and functions.
Starred by 3.1K users
Forked by 197 users
Languages   TypeScript 98.1% | JavaScript 1.9%
🌐
Hacker News
news.ycombinator.com › item
Ask HN: Anybody Know of an AI / LLM Based JavaScript Unminifier? | Hacker News
April 22, 2023 - I could probably build this myself: · I've used this tool https://github.com/shapesecurity/unminify which does a decent job at unminifying stuff but I'm sure there are better ones out there but this would make a good first pass and then I could feed it through Codex with some appropriate prompt.
🌐
Unminify
unminify.io
Unminify
Safety Level: · Wildly Unsafe · Useless · Mostly Safe · Unsafe · GitHub · Unminify
🌐
Nero
nero.com › eng › webservices › nero-unminifyjs
Unminify JS: Improve readability
Unminifying your JavaScript code can provide a host of benefits, including improved readability and easier debugging. Optimizations could lead to faster page load speed. Unminifying involves reversing the process of code minification, which ...
🌐
GitHub
github.com › shapesecurity › unminify
GitHub - shapesecurity/unminify: reverse many of the transformations applied by minifiers and naïve obfuscators · GitHub
let { unminifySource } = require('unminify'); let sourceText = '/* a minified/"obfuscated" JavaScript program */'; console.log(unminify(sourceText)); // or, with options console.log(unminifySource(sourceText, { safety: unminify.safetyLevels.UNSAFE, ...
Author   shapesecurity
🌐
CO/AI
getcoai.com › news › chatgpt-unminifies-javascript-code-unveiling-ais-development-potential
ChatGPT Unminifies JavaScript Code, Unveiling AI's Development Potential - CO/AI
August 30, 2024 - AI-powered code unminification reveals surprising capabilities: OpenAI’s ChatGPT demonstrates an impressive ability to decipher and reconstruct minified JavaScript code, offering developers a powerful tool for code analysis and learning.
Find elsewhere
🌐
npm
npmjs.com › search
unminify - npm search
unminify · minify · loganisadev2npm• 1.0.0 • 4 years ago • 0 dependents • ISCpublished version 1.0.0, 4 years ago0 dependents licensed under $ISC · 3 · > Deobfuscate Javascript code using LLMs ("AI") humanify · decompiler · decompile · unobfuscate ·
🌐
Code Beautify
codebeautify.org › jsviewer › 486242
Unminified
Users can also beautify JS File by uploading the file.
🌐
Hacker News
news.ycombinator.com › item
OpenAI is good at unminifying code | Hacker News
June 14, 2024 - https://github.com/jehna/humanify · Sometimes when I refactor, I do this manually with an LLM. It is useful in at least two ways: it can reveal better (more canonical) terminology for names (eg: 'antiparallel_line' instead of 'parallel_line_opposite_direction'), and it can also reveal names ...
🌐
IA Tools
iatools.tools › home › ai tools for coding › unminify your trusted resource for code optimization
Unminify Your Trusted Resource for Code Optimization - IATools
January 25, 2025 - In the world of development, every line of code matters, and Unminify empowers you to produce cleaner, more efficient, and highly readable code with ease. Try it today, and witness the transformation in your coding workflow.” · ai tools for seo, AI Marketing Tools, ai tools website, Popular AI Tools
🌐
Glama
glama.ai › blog › openai is shockingly good at unminifying code
Glama – MCP Hosting Platform
const tT = () => { const e = j.useRef(null); const [t, n] = j.useState({ height: null, width: null }); j.useEffect(() => { function r() { n({ height: window.innerHeight, width: window.innerWidth }); } if (typeof window < "u") { n({ height: window.innerHeight, width: window.innerWidth }); window.addEventListener("resize", r); return () => window.removeEventListener("resize", r); } }, []); j.useEffect(() => { const r = e.current; if (!r) return; const i = 12; const s = ra(t.width / i) * 1.6; const o = ra(t.height / i); const l = { aspect: s / o }; const u = setInterval(() => { let c = ""; for (l
🌐
Reddit
reddit.com › r/programming › using chatgpt to reverse engineer minified javascript
r/programming on Reddit: Using ChatGPT to reverse engineer minified JavaScript
August 29, 2024 - You can use https://jsmon.sh/tools/unminify/ to unminify Javascript first and then send it to ChatGPT for better reverse engineering.
🌐
Slashdot
developers.slashdot.org › story › 14 › 06 › 03 › 2111226 › machine-learning-used-for-javascript-code-de-obfuscation
Machine Learning Used For JavaScript Code De-obfuscation - Slashdot
New submitter velco writes: "ETH Zurich Software Reliability Lab announced JSNice, a statistical de-obfuscation and de-minification tool for JavaScript. The interesting thing about JSNice is that it combines program analysis with machine learning techniques to build a database of name and type ...
🌐
Stack Overflow
stackoverflow.com › questions › 35682684 › how-to-correctly-unminify-js-and-css-and-reference-them-in-html5
How to correctly unminify js and css, and reference them in html5?
Then I have moved to deeply minified version, what is pretty neat as everything works without a single reference to css or js files. Now, inside the deeply minified version the styles and script are written in one line. I am not going to include them in post as they are more than 30000 characters, but all the files are available within the template link mentioned above. I've used this css unminifier - and this js unminifier - to somehow convert them into readable and understandable format.