Black. We don't care that it may look bad. We don't want to argue about formatting. We know it isn't configurable, that's the point. We don't want to deal with everyone's configuration preferences. Answer from jorge1209 on reddit.com
🌐
GitHub
github.com › life4 › awesome-python-code-formatters
GitHub - life4/awesome-python-code-formatters: A curated list of awesome Python code formatters · GitHub
Formatters that do only one job and do it well. add-trailing-comma: adds trailing commas to calls and literals. decrapify: some scripts that use pybowler.io for refactoring Python code.
Starred by 379 users
Forked by 22 users
Languages   Shell
🌐
Reddit
reddit.com › r/python › which code formatter do you use?
r/Python on Reddit: Which code formatter do you use?
December 21, 2022 - Python's indentation is, of course, part of the language, so formatters are more restricted. ... PyCharm's formatting is fine for me. I have to use black at work and it will mangle bits of code to satisfy its own internal rules, we sometimes add comments to prevent formatting for a section of code.
Discussions

Python Formatter Tool - Stack Overflow
I was wondering if there exists a sort of Python beautifier like the gnu-indent command line tool for C code. Of course indentation is not the point in Python since it is programmer's responsibilit... More on stackoverflow.com
🌐 stackoverflow.com
formatting - How do I autoformat some Python code to be correctly formatted? - Stack Overflow
I have some existing code which isn't formatted consistently -- sometimes two spaces are used for indent, sometimes four, and so on. The code itself is correct and well-tested, but the formatting is awful. Is there a place online where I can simply paste a snippet of Python code and have it ... More on stackoverflow.com
🌐 stackoverflow.com
Autoformatting?
When you go with black: I would make one commit auto formatting the whole codebase. Then a second commit adding the first to a git ignore revs file so that your git blame isn’t totally nuked. More on reddit.com
🌐 r/Python
103
101
October 16, 2023
Best practice for formatting simple code
you should have a dedicated function "display" that "prints" also a dedicated function that inputs and returns the value. then "call" the functions in main. so much easier to test. More on reddit.com
🌐 r/learnpython
12
6
December 22, 2023
🌐
DeepSource
deepsource.com › blog › python-code-formatters
Python code formatters • DeepSource
November 2, 2020 - YAPF, or Yet Another Python Formatter, takes a different approach in formatting code than the other tools listed here. It works on the premise that code that conforms to the PEP 8 guidelines may not be re-formatted, but it doesn't mean that the code looks good. So it's algorithm takes the code and reformats it to the best ...
🌐
Code Beautify
codebeautify.org › python-formatter-beautifier
Python Formatter and Beautifier
Best Python Formatter will help to format, beautify, minify, compact Python code, string, text. Format, Save, Share
🌐
Visual Studio Code
code.visualstudio.com › docs › python › formatting
Formatting Python in VS Code
November 3, 2021 - Search the VS Code Marketplace for the formatter extension of your choice. Microsoft publishes the following formatting extensions: ... Note: If you don't find your preferred formatter in the table above or in the Marketplace, you can add support for it via an extension. You can use the Python ...
🌐
Medium
medium.com › @jillvillany_7737 › my-quest-for-the-best-python-formatter-cd25a544ef81
My Quest for the Best Python Formatter | by Jill Villany | Medium
October 21, 2025 - I found it exponentially harder to read than the unformatted code I started with. I knew there had to be better options out there, so I experimented with other popular tools like Ruff, Autopep8 and YAPF (Yet Another Python Formatter). Ultimately, I found YAPF to have the best readability with only 1 tweak needed out of the box.
🌐
GitHub
github.com › psf › black
GitHub - psf/black: The uncompromising Python code formatter · GitHub
Black is the uncompromising Python code formatter. By using it, you agree to cede control over minutiae of hand-formatting. In return, Black gives you speed, determinism, and freedom from pycodestyle nagging about formatting.
Starred by 41.4K users
Forked by 2.7K users
Languages   Python
Find elsewhere
🌐
Pyrfecter
pyrfecter.com › format-python-code
Format Python code online · Pyrfecter
June 26, 2025 - Pyrfecter uses Black to format your Python code. Black is maintained by the Python Software Foundation, so you can be sure that Python code formatted with Pyrfecter is going to match Python best practices.
🌐
Built In
builtin.com › data-science › autopep8-vs-black
Python Auto Formatter: Autopep8 vs. Black | Built In
October 5, 2023 - One of the major differences is that Black is an opinionated formatter, meaning that it always converts the entire codebase into its own style, whereas autopep8 preserves the input style to some extent and only fixes the necessary parts. I’ve used both tools, and I’d like to share with you why I prefer Black over autopep8. Autopep8 is a Python tool that automatically formats code to match the PEP 8 style guide.
🌐
Better Programming
betterprogramming.pub › simple-hacks-to-automate-python-code-beautification-5ad934cf5a29
4 Python Packages to Beautify and Format Your Codebases | by Tapas Das | Better Programming
January 9, 2022 - 4 Python Packages to Beautify and Format Your Codebases Automate clean up of your Python code Have you ever come across a poorly written piece of Python code? I’m talking about a tangled mess where …
🌐
Astral
docs.astral.sh › ruff › formatter
The Ruff Formatter - Astral Docs
An extremely fast Python linter and code formatter, written in Rust.
🌐
GitHub
github.com › google › yapf
GitHub - google/yapf: A formatter for Python files · GitHub
YAPF is a Python formatter based on clang-format (developed by Daniel Jasper). In essence, the algorithm takes the code and calculates the best formatting that conforms to the configured style.
Starred by 14K users
Forked by 900 users
Languages   Python
🌐
Safjan
safjan.com › black-vs-yapf
Which Python Code Formatter Is Better - Black or Yapf?
July 11, 2023 - On the other hand, yapf was first released in 2015 and is also popular among Python developers. Yapf is configurable, meaning that it allows users to customize the formatting rules to suit their preferences. This section will compare Black and yapf based on various criteria. Black enforces a strict set of formatting rules that are non-configurable. The aim of these rules is to provide consistent code formatting and reduce the time spent on code review.
🌐
TutorialsPoint
tutorialspoint.com › online_python_formatter.htm
Online Python Formatter | Tutorialspoint
Online Python Formatter and Beautifier - Try online Python Code formatter and beautifier and Editor to beautify and format Python code using jQuery Plug-in
🌐
PyPI
pypi.org › project › black
black · PyPI
The uncompromising code formatter. ... Black is the uncompromising Python code formatter. By using it, you agree to cede control over minutiae of hand-formatting. In return, Black gives you speed, determinism, and freedom from pycodestyle nagging ...
      » pip install black
    
Published   Mar 12, 2026
Version   26.3.1
🌐
Curiousity
curiousity.ca › 2024 › best-practices-black
Best practices in practice: Black, the Python code formatter | Curiousity?
September 27, 2024 - Black’s tagline is “the uncompromising Python code formatter” and it pretty much is what it says on the tin: it can be used to automatically format Python code, and it’s reasonably opinionated about how it’s done with very few options to change. It starts with pep8 compliance (that’s the python style guide for those of you don’t need to memorize such things) and takes it further.
🌐
Minifier
minifier.org › python-beautifier
Python Beautifier - Format & Beautify Python Code Online
Python Beautifier & Formatter is a free online tool to format Python code by fixing indentation, spacing, and line breaks for clean, readable output.
🌐
Black
black.readthedocs.io
Black 26.3.0 documentation
I can now do refactorings in about 1% of the keystrokes that it would have taken me previously when we had no way for code to format itself. ... Black is opinionated so you don’t have to be. Hynek Schlawack, creator of attrs, core developer of Twisted and CPython: An auto-formatter that doesn’t suck is all I want for Xmas!