New

JavaScript Formatter

Runs in browser

Beautify 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

  1. Choose indentation

    For Beautify, pick 2 spaces, 4 spaces, or tabs before formatting.

  2. Minify

    Switch to Minify to compact code; a size comparison appears when relevant.

  3. Export

    Copy or download .js; open local files with the upload zone below the panels.

Examples

  • Arrow function

    Pretty-print expands across lines.

    Input
    const f=()=>1+1;
    Output
    const 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.

You might find these useful too.