Skip to content

Install ALink Tools

Free browser tools for images, PDFs, media, text and web checks. Most tools process files locally on your device.

  1. Tap the Share button in the Safari toolbar.
  2. Scroll down and tap Add to Home Screen.
  3. Tap Add. ALink Tools then opens from your Home Screen like an app.

JavaScript Formatter

Indent JavaScript so you can read it, or compact whitespace. js-beautify runs in this tab. It does not rename variables or transpile TypeScript.

Runs in your browserjs-beautify (MIT)Runs in your browser
1

JavaScript

Limits

  • The input is limited to 2 MB of UTF-8 text (8 MB if you load a file). Larger files can run out of memory in a phone browser tab.
  • Not a minifier that renames identifiers, and not a TypeScript/JSX compiler or linter.
  • Syntax errors may cause messy output or a failure.
  • Formatting can change ASI-sensitive line breaks in rare cases; check the result if you rely on automatic semicolon insertion.
2

Formatted JavaScript

How to use JS Formatter

  1. Paste JavaScriptType, paste or load a .js file.
  2. Choose indent or compact outputSet the indent size, or compact whitespace without renaming identifiers.
  3. Copy or downloadCopy the result or download a .js file.

Beautify, not a compiler

js-beautify reprints JavaScript with consistent indent and wrapping. Compact mode removes extra whitespace but does not mangle names (unlike Terser or esbuild minify). TypeScript, JSX and Flow syntax are not officially supported and may fail or wrap badly.

The tool does not run the code, resolve modules, or apply ESLint rules.

Frequently asked questions

Is my text or file uploaded?

No. Everything runs in your browser tab with JavaScript. Nothing you type, paste or drop is sent to a server, logged or stored by ALink Tools.

Can I format TypeScript or JSX?

Not reliably. This page is a JavaScript beautifier. Some TS/JSX may appear to work and then break. Use a TypeScript-aware formatter for those files.

Is compact mode the same as Terser?

No. Identifiers, quotes and dead code are left alone. Only extra whitespace is reduced.

Does the code run in this page?

No. It is only reprinted as text.

Related tools

All tools