Skip to content
SPECIFICTION
Get listed

Black vs Ruff

Black

black.readthedocs.io

Ruff

docs.astral.sh

Side by side

FigureBlackRuff
Price fromFreeFree
Free planYesYes
Free trial——
Open source——
Web—Yes
WindowsYesYes
macOSYesYes
LinuxYesYes
Self-hostedYesYes
Plans published11
Spec score · Code Formatting Tools8.7 (#1)7.9 (#12)
Spec score · Code formatters8.7 (#1)7.8 (#7)
DockerOfficial Black Docker images are available, with tags for releases and prereleases.The maker publishes Ruff as a Docker image tagged by release and with a latest tag.
Editor integrationsThe documentation describes integrations for editors including PyCharm, Vim, Neovim, Visual Studio Code, and Sublime Text.The setup guide documents integrations including VS Code, Sublime Text, PyCharm, and Zed.
Editor supportDocumented editor integrations include Emacs, PyCharm and IntelliJ IDEA, Vim, Neovim, Visual Studio Code, SublimeText, and others.The built-in Ruff Language Server provides diagnostics, code actions to fix them, and formatting; the docs recommend pairing it with another Python language server for navigation and autocompletion.
InstallationBlack installs with pip or pipx and requires Python 3.10 or later to run.Ruff can be installed using uv, pip, pipx, standalone installers, and package managers including Homebrew and Conda.
PurposeBlack is an opinionated formatter for Python code that follows PEP 8.Ruff is a Python linter and code formatter written in Rust.

Plans

Black

  • BlackFree

Black pricing →

Ruff

  • RuffFree

Ruff pricing →

In their own words

Black

Black is a free, MIT-licensed formatter for Python code that follows PEP 8. It reformats whole files in place and uses a default line length of 88 characters. Its limited style choices are intended to keep code consistent across projects; indentation style cannot be configured. After formatting, Black checks whether the abstract syntax tree remains effectively equivalent and raises an error if the check fails. Install it with pip; it requires Python 3.10 or newer. The documentation lists editor integrations including Emacs, PyCharm, IntelliJ IDEA, Vim, Neovim, Visual Studio Code and Sublime Text, as well as GitHub Actions and doctest workflows. Notebook formatting is available with the jupyter extra, though Black skips cells containing certain magics or invalid syntax. It also includes blackd, an HTTP server that binds to localhost by default. Black is primarily a command-line tool and does not provide a Python interface. Stable releases preserve formatting within the same calendar year when the options match.

Visit black.readthedocs.io

Ruff

Ruff is a Python linter and code formatter written in Rust, available free under a permissive open-source license. It includes more than 900 built-in lint rules, including native versions of popular Flake8 plugin rules, and can automatically correct violations such as unused imports. Its formatter aims to serve as a replacement for Black, though the documentation allows for differences in some cases. The built-in Ruff Language Server supplies diagnostics, fixes, and formatting; the documentation recommends pairing it with another Python language server for navigation and autocompletion. Setup guidance covers VS Code, Sublime Text, PyCharm, and Zed, while CI support includes GitHub Actions, GitLab CI/CD, and pre-commit hooks. Ruff can be installed through uv, pip, pipx, standalone installers, Homebrew, Conda, and other package managers. It supports configuration in pyproject.toml, ruff.toml, or .ruff.toml. A Bandit-derived rule group checks for common Python security issues. Ruff runs on Linux, macOS, and Windows, and is also published as a Docker image. The maker describes it as 10–100x faster than tools such as Flake8 and Black.

Visit docs.astral.sh