JavaScript Formatter
Paste JavaScript to add line breaks after statements and braces with consistent indentation. Useful for quickly reading minified code.
Lines
14
Formatted JavaScript
function greet(
name
){
const msg=`Hello, ${name}!`;
if(
name
){
console.log(
msg
);
}return msg;
}A lightweight, syntax-aware beautifier. For project-wide formatting, use a dedicated tool such as Prettier or ESLint.
Formula
Braces, brackets and semicolons trigger new lines and indentation changes.
Frequently asked questions
No. It is a quick beautifier for reading code in the browser; Prettier remains the better choice for enforcing style across a codebase.
No. Only whitespace is added or removed.
Related tools
Keep going — these tools solve the problems that usually come next.