
Black
Summary
Black is a Python code formatter that applies a consistent style while following PEP 8. It rewrites entire files in place and uses an 88-character default line length. Its limited style choices are intended to keep formatting consistent across projects; indentation style cannot be configured. After formatting, Black checks whether the code's abstract syntax tree is effectively equivalent and raises an error if that check fails. Install it with pip; it requires Python 3.10 or newer. Black is primarily a command-line tool and does not provide a Python interface. Its documented integrations include editors and IDEs such as Emacs, PyCharm, IntelliJ IDEA, Vim, Neovim, Visual Studio Code, and Sublime Text, as well as GitHub Actions and doctest formatting. Notebook formatting is available with the jupyter extra, but cells with certain magics or invalid syntax are skipped. The free, MIT-licensed tool also includes blackd, an HTTP server that binds to localhost by default. Stable releases preserve formatting within the same calendar year when options match.
Who it is for
Black suits Python developers who want consistent formatting with few style decisions. It can also suit teams using documented editor integrations or GitHub Actions.
What is good
- Free and licensed under MIT.
- Formats Python files in place.
- Checks that formatting preserves an effectively equivalent syntax tree.
- Supports notebooks through the jupyter extra.
- Documented integrations include editors and GitHub Actions.
What to know first
- Requires Python 3.10 or newer.
- Indentation style cannot be configured.
- Does not provide a Python interface.
- Some notebook cells are skipped.
Verdict
Black offers a constrained approach to Python formatting, with integrations for editors, CI, and notebooks. Its command-line focus and fixed indentation style may not fit every workflow.
Black plans and pricing
All plansCompared on code formatting tools
- Free plan
- Yesblack.readthedocs.io
- Supported languages
- Pythonblack.readthedocs.io
- Supported platforms
- Windows, macOS, Linux, local HTTP APIblack.readthedocs.io
- Editor integration
- Yesblack.readthedocs.io
- Ignore files
- Yesblack.readthedocs.io
- Changed-lines formatting
- Yesblack.readthedocs.io
- Library API
- Noblack.readthedocs.io
- License model
- open_sourceblack.readthedocs.io
Facts
- Purpose
- Black is an opinionated formatter for Python code that follows PEP 8.black.readthedocs.io · 28 Sept 2026
- Formatting
- Black reformats whole files in place and uses a default line length of 88 characters.black.readthedocs.io · 28 Sept 2026
- Consistent style
- Black limits style options and aims to make code look consistent across projects.black.readthedocs.io · 28 Sept 2026
- Safety check
- Black checks that reformatted code has an effectively equivalent abstract syntax tree and raises an error if the check fails.black.readthedocs.io · 28 Sept 2026
- Installation
- Black installs with pip and requires Python 3.10 or newer to run.black.readthedocs.io · 28 Sept 2026
- Notebook support
- Jupyter Notebook formatting is available by installing Black with the jupyter extra.black.readthedocs.io · 28 Sept 2026
- Editor integrations
- The documentation describes integrations for editors including PyCharm, Vim, Neovim, Visual Studio Code, and Sublime Text.black.readthedocs.io · 28 Sept 2026
- CI integration
- Black provides a GitHub Actions integration that supports GitHub-hosted runner operating systems.black.readthedocs.io · 28 Sept 2026
- Local server
- Black includes blackd, an HTTP server that binds to localhost by default.black.readthedocs.io · 28 Sept 2026
- Docker
- Official Black Docker images are available, with tags for releases and prereleases.black.readthedocs.io · 28 Sept 2026
- API limit
- Black is fundamentally a command-line tool and does not currently provide a Python interface.black.readthedocs.io · 28 Sept 2026
- License
- Black is licensed under the MIT License.black.readthedocs.io · 28 Sept 2026
- Style stability
- For stable releases, code formatted with a release remains unchanged under other releases in the same calendar year when using the same options.black.readthedocs.io · 28 Sept 2026
- What it does
- Black is an opinionated code formatter that formats Python code with consistent style.black.readthedocs.io · 29 Sept 2026
- Code review
- Black says it can make code review faster by producing the smallest diffs possible.black.readthedocs.io · 29 Sept 2026
- Integrations
- The documentation lists editor and IDE, GitHub Actions, source version control, and doctest formatting integrations.black.readthedocs.io · 29 Sept 2026
- Editor support
- Documented editor integrations include Emacs, PyCharm and IntelliJ IDEA, Vim, Neovim, Visual Studio Code, SublimeText, and others.black.readthedocs.io · 29 Sept 2026
- Command line tool
- Black is fundamentally a command line tool and the documentation says it does not yet provide a Python interface.black.readthedocs.io · 29 Sept 2026
- Configuration limit
- Black provides no option to configure indentation style and says requests for that option will not be considered.black.readthedocs.io · 29 Sept 2026
- Notebook limits
- Black skips notebook cells containing automagics, non-Python or multiline magics, transformed magic code, or invalid syntax.black.readthedocs.io · 29 Sept 2026
- Python compatibility
- Black promises support for Python versions that have not reached end of life, for both running Black and formatting code.black.readthedocs.io · 29 Sept 2026
Best Black alternatives
See all 12Where it ranks on Everything Xiaomi
Is Black yours?
Claim it for free: prove the domain, then correct facts, plans and screenshots. An editor reviews every change.
Sources
- black.readthedocs.io/en/stable/the_black_code_style/index.ht· checked 28 Sept 2026
- black.readthedocs.io/en/stable/usage_and_configuration/the_b· checked 28 Sept 2026
- black.readthedocs.io/en/stable/faq.html· checked 28 Sept 2026
- black.readthedocs.io/en/stable/getting_started.html· checked 28 Sept 2026
- black.readthedocs.io/en/stable/integrations/editors.html· checked 28 Sept 2026
- black.readthedocs.io/en/stable/integrations/github_actions.h· checked 28 Sept 2026
- black.readthedocs.io/en/stable/usage_and_configuration/black· checked 28 Sept 2026
- black.readthedocs.io/en/stable/usage_and_configuration/black· checked 28 Sept 2026
- black.readthedocs.io/en/stable/· checked 28 Sept 2026
- black.readthedocs.io/en/stable/integrations/index.html· checked 29 Sept 2026

