JS Modernizer
Upload or paste legacy JavaScript and instantly convert var declarations to modern const syntax.
Modernized JavaScript
About this tool
Older JavaScript codebases are full of var declarations, which have looser scoping rules than the let and const keywords introduced in ES6. This tool scans your code and rewrites every var to const, giving you a quick starting point for modernizing legacy scripts.
Upload a .js file directly or paste code into the textarea, run the conversion, and copy the modernized output. It's a handy first pass before a deeper refactor, especially when inheriting an old project or cleaning up inline scripts.
Good to know
This is a straightforward text-based conversion, not a full AST-aware refactor — always review the output and adjust to let where a variable is actually reassigned, since const only works for bindings that never change.
