JavaScript Formatter
Turn minified or messy JavaScript into clean, readable code. Paste it in, press Format, and get proper indentation and line breaks — all in your browser, your code is never executed or uploaded.
Input JavaScript
Formatted output
Format some code to see statistics here.
How to use
- Paste your minified or messy JavaScript into the input box.
- Choose your indent size — 2 spaces, 4 spaces, or a tab.
- Press Format. The readable code appears in the output box.
- Copy it or download it as a .js file.
Note: This is a safe text-based formatter. It never runs your code — it only rearranges whitespace.
Tips
- Minified code from one line becomes easy to read in a single click — great for debugging.
- Two-space indentation keeps nested code compact; four spaces makes deep nesting easier to follow.
- The formatter keeps strings and comments intact, even when they contain braces or semicolons.
- Very long single lines may still wrap in the editor — that is only display, the code is unchanged.