Programming

Python Formatter & Syntax Checker

Format Python code with Black 24.10.0 — the same formatter used by Django, pandas and most Python projects — running in your browser through Pyodide. Optionally sort imports with isort, choose the line length, and get exact syntax errors with line numbers.
Black 24.10.0Runs in your browserNothing is uploaded

Workspace

Options

Groups and sorts imports, compatible with Black.

Black's --skip-string-normalization.

Black's --skip-magic-trailing-comma.

How to use this tool

  1. 1Paste Python code or open a .py file.
  2. 2Wait a few seconds the first time while Python and Black load (once per visit).
  3. 3Choose the line length and options; the result updates as you type.
  4. 4Copy the formatted code or download the .py file.

Frequently asked questions

Yes. Black 24.10.0 (and isort 5.13 when enabled) is installed into Python running in your browser, so the output is the same as running black on your computer with the same settings.

Python and Black are downloaded once per visit. After that, formatting is instant.

Black cannot format invalid code, so the tool shows Python’s own error message with the line and column instead.

No. The tool runs real Python 3.11 (Pyodide, Python compiled to WebAssembly) inside your browser. The first run downloads the runtime (about 10 MB) once per visit; your code never leaves your device.