Python Formatter
Paste Python and get Black-compatible formatting from Ruff's formatter, running as WebAssembly in your browser. Turn on Lint to see Ruff diagnostics inline, and convert a Python dict literal to JSON from the command palette.
FAQ
- How do I format Python online?
- Paste your Python into the input pane and press Format (⌘/Ctrl + Enter). Pretty Lush formats it with Ruff in your browser and shows the result side by side, ready to copy, download or share.
- Is the output the same as Black?
- Ruff's formatter is designed as a drop-in replacement for Black, so output matches Black for the vast majority of code.
- Is my code uploaded anywhere?
- No. Formatting runs entirely in your browser; the code you paste is not sent to a server. The only feature that talks to a backend is the optional encrypted share link, which encrypts the snippet in your browser first.