sitekits.dev
press ⌘K to switch tools
FORMAT & CONVERT

JavaScript Formatter

Reformat minified or cramped JavaScript into readable, indented code.

local
js-format
§01 ABOUT THIS TOOL

Overview

Minified bundles and one-liner snippets are painful to read. This tool re-indents JavaScript with the js-beautify engine — two-space indentation, one statement per line — so you can inspect third-party scripts, debug production bundles, or clean up quick prototypes. Everything runs locally in your browser.

How to use

  1. Paste your code into the JavaScript field.
  2. The Formatted field updates instantly as you type — no button to press.
  3. Copy the result from the output field.

Examples

  • function f(a){return a?1:2}
function f(a) {
  return a ? 1 : 2
}
  • A minified IIFE such as (function(){var x=1;console.log(x)})() expands into a readable multi-line block.

Notes

This is a pretty-printer, not a deobfuscator: it restores layout but cannot recover original variable names from minified code (a, b, t stay as they are). It also does not validate syntax — broken input is formatted on a best-effort basis. Modern syntax handled by js-beautify, including arrow functions and template literals, formats correctly.

FAQ
Is my code sent to a server?
No. Formatting runs entirely in your browser using the js-beautify library. Your source code never leaves your machine.
Does the formatter execute my JavaScript?
No. The code is only parsed and re-printed as text — it is never evaluated, so pasting untrusted scripts to inspect them is safe.
Will formatting change what the code does?
No. Only whitespace, line breaks, and indentation are rewritten. Identifiers, literals, and statement order are untouched, so behavior is identical.