JavaScript Formatter
Re-indent JavaScript by braces, brackets and parentheses without touching any literal.
Your JavaScript
Lines: —
How to use the JavaScript Formatter
- Paste the JavaScript you want to tidy up.
- Choose an indent width and whether missing semicolons should be added.
- Click Format, check the result, then copy it.
Features
- Indents by braces, brackets and parentheses
- Strings, templates, comments and regex literals preserved
- Configurable indent width and semicolon option
- Runs locally, no uploads
Advertisement
Frequently Asked Questions
Common questions about the free online javascript formatter.
It re-indents your source so nested blocks line up, adding or keeping line breaks after
braces and semicolons.
No. Only whitespace between tokens is rewritten, and literals, comments and regular
expressions are copied exactly as written.
A template literal is copied character for character, including the embedded expressions, so
its runtime value stays identical.
When enabled, lines that look like complete statements and do not already end with a
semicolon get one added.
No. This tool beautifies code. Use a dedicated minifier when you want the smallest possible
file.
It handles files of many thousands of lines, depending on the memory available to your
browser tab.
No. Formatting happens entirely in your browser, so your source never leaves your device.
Yes, the JavaScript formatter is completely free with no account or sign-up required.
Last updated: October 10, 2026