Back to Tools
Console Log Cleaner
Console Log Cleaner
Clean your production code by removing all console.log statements
JavaScript Tool
Cleaned Code
About the Console Log Cleaner
Remove console statements from JavaScript before you publish it.
How to use the Console Log Cleaner
- Paste your code into the input box, or click Load Sample to load an example.
- Choose the Cleaning Level: all console.* calls, only console.log(), only console.debug() or only profiling calls such as time and timeEnd.
- Press Remove All Logs.
- Use Copy (or Download where shown) to keep the result. Clear empties the box.
Worked example
console.log("test"); is removed and the rest of your code is left in place.
Tips
- Review the result. If a console call sits inside an if statement without braces, removing it can change behaviour.
- Console output can leak information in production.
Frequently Asked Questions
They can expose internal details and slightly slow down code in production.