Tested tool guide
Tested browser tools
Checked August 16, 2026
What Python Formatter (Black / autopep8) does, with a checked example
This tool reformats pasted Python code to a consistent style. Pick an engine: Black, which rewrites the whole file to its opinionated canonical form, or autopep8, which surgically fixes individual PEP 8 violations and leaves everything else alone. A line-length setting controls where long lines wrap, at 88 characters for Black's default and 79 for PEP 8. Everything runs in the browser, so your code is never uploaded. The surprise most users hit: Black does not just re-indent. It rewrites quotes, explodes long signatures onto one parameter per line, and removes redundant parentheses and backslashes, so the output can look structurally different from the input.
Worked example
A concrete input and expected output from the current implementation.
Input
def very_important_function(template: str, *variables, file: os.PathLike, engine: str, header: bool = True, debug: bool = False):
"""Applies `variables` to the `template` and writes to `file`."""
with open(file, 'w') as f:
f.write(template.format(*variables)) ->
Expected output
def very_important_function(
template: str,
*variables,
file: os.PathLike,
engine: str,
header: bool = True,
debug: bool = False,
):
"""Applies `variables` to the `template` and writes to `file`."""
with open(file, "w") as f:
f.write(template.format(*variables)) In Black mode with the default 88-character limit, the 129-character signature line cannot fit on one line, so Black explodes it: one parameter per line, a trailing comma after the last parameter, and the closing parenthesis moved to its own line. The single-quoted 'w' is also normalized to double quotes, Black's default quote style. The docstring and the two body lines already fit, so they pass through unchanged. autopep8 mode would not change the quotes and would rewrite far less.