New
JavaScript Formatter
Runs in browserBeautify or minify JavaScript with flexible indentation (2 spaces, 4 spaces, or tabs). Compare byte size after minify and download .js.
JavaScript Formatter tool
1
Output
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
Files never leave your browser.
Drag and drop a file here, or tap to select
Chain to another tool
Send this output to another tool instantly — no copy-paste needed.
Produce output above to enable chaining.
How to use
Choose indentation
For Beautify, pick 2 spaces, 4 spaces, or tabs before formatting.
Minify
Switch to Minify to compact code; a size comparison appears when relevant.
Export
Copy or download .js; open local files with the upload zone below the panels.
Examples
Arrow function
Pretty-print expands across lines.
Inputconst f=()=>1+1;Outputconst f = () => 1 + 1;
Frequently asked questions
- Will minify rename variables?
- This tool uses js-beautify for layout; it does not perform renaming like a full bundler minifier.
- Is my code sent to a server?
- No. Everything runs in your browser.
Related tools
You might find these useful too.