Programming
Python Formatter & Syntax Checker
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
- 1Paste Python code or open a .py file.
- 2Wait a few seconds the first time while Python and Black load (once per visit).
- 3Choose the line length and options; the result updates as you type.
- 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.
Related tools
Python Line-by-Line Executor — Step Execution
Run Python one line at a time: see the line about to run, output as it is printed, changed variables and line counts.
Text Diff Checker
Compare two texts or files side by side or unified, by line, word or character, and download a unified patch.
Python to TXT Converter
Convert Python source code to a clean .txt file, with optional comment removal, line numbers and whitespace clean-up.