JavaScript Formatter

Turn compacted or inconsistently indented JavaScript into readable code. Formatting runs in your browser with js-beautify — your source never leaves the device.

Result

Paste code, then Format. Processing stays in your browser.

How to format JavaScript

  1. Paste JavaScript (not TypeScript or JSX).
  2. Choose indent: 2 spaces, 4 spaces, or tab.
  3. Click Format, or press Ctrl+Enter (Cmd+Enter on Mac).
  4. Copy or download the pretty-printed source.

FAQ

No. js-beautify runs entirely in your browser. Your code is not sent to DevTilt.
Yes. Use 2 spaces (default), 4 spaces, or tabs. Format is button-driven so large files are not reformatted on every keystroke.
No. Input is treated as JavaScript. TypeScript-only syntax is unsupported. JSX may indent incorrectly — use a dedicated JSX tool or your editor for that.
Inputs over 500KB show a warning. Inputs over 2MB are rejected so the tab stays responsive.
Syntax errors, template literals with nested HTML, or non-JavaScript constructs can confuse the beautifier. Fix parser errors first, or format smaller snippets to isolate the problem line.

Related tools