Format Python code with Ruff WASM — Black-compatible, line width 88, double quotes, magic trailing comma. Instant, browser-based, no installation needed.
The Python Formatter is a Ruff WASM-powered, browser-based tool that instantly formats Python source code to Black-compatible style. Using a WebAssembly port of the Ruff formatter (the fastest Python linter and formatter) running in a Web Worker, it applies a default line width of 88 columns (Black's default), double-quote string normalisation, magic trailing comma preservation, and PEP 8-compliant indentation. The result is identical to running `ruff format` or `black` locally — without any installation. Your code never leaves the browser.
QIs this the same as running Black?
Yes — Ruff's formatter is designed to be a drop-in replacement for Black and produces byte-for-byte identical output in the vast majority of cases. It respects the same conventions: 88-column lines, double quotes, trailing commas.
QWhat Python versions and syntax are supported?
Python 3.8 through 3.13 — including match/case (pattern matching), walrus operator (:=), PEP 604 union types (X | Y), type aliases (type X = ...), and all modern type hint syntax.
QIs my code sent to a server?
No. The Ruff WASM binary runs entirely inside your browser in a Web Worker. No code is transmitted to any server.
QCan I change the line length or quote style?
The default configuration matches Black (line width 88, double quotes, magic trailing comma respected). Advanced configuration options are not yet exposed in the UI.