JavaScript Formatter

Beautify and minify JavaScript

Indent:
Input
Output
Formatted JavaScript will appear here...

Examples

Type JavaScriptApply
Format function greet(name){if(!name){return "Hello!"}return "Hello, "+name+"!"}
Format const users=[{id:1,name:"Ann"},{id:2,name:"Bob"}];const names=users.map(u=>u.name).filter(Boolean);
Format class Queue{constructor(){this.items=[]}push(x){this.items.push(x);return this}pop(){return this.items.shift()}get size(){return this.items.length}}
Format async function load(url){try{const res=await fetch(url);if(!res.ok)throw new Error(res.status);return await res.json()}catch(e){console.error(e);return null}}
Minify function add(a, b) { // sum two numbers return a + b; }
Minify export const TAX = 0.23; export function gross(net) { return net * (1 + TAX); }
© 2026 Developer Toolbox. All rights reserved. About