skillfed

codespell

Fix common misspellings in text files

codespell v2.4.3 6.3M downloads/30d#1,924 on PyPI2,415
Copyleft license GPL-2.0-only Active released

What it is and what it does

Codespell is a command-line tool that scans text files for a curated set of common misspellings and suggests corrections. Unlike full dictionary checkers, it targets known typos (like "adn" for "and") rather than validating every word, which keeps false positives low when working with niche terminology, code identifiers, or domain-specific language. It's designed primarily for source code but works on any text file.

The tool runs as a standalone CLI with no external runtime dependencies, making it easy to integrate into CI/CD pipelines, pre-commit hooks, or local development workflows. It supports dry-run mode (default), interactive correction, batch writing, word allowlists, file exclusion patterns, and configuration via INI or TOML files. You can also embed inline ignore directives directly in source code using comments.

Use it for:

  • Catch typos in source code comments and docstrings before committing.
  • Run as a pre-commit hook or CI step to enforce spelling standards across a repository.
  • Fix bulk misspellings across a large codebase with the `-w` flag and interactive review.
  • Maintain a project-specific allowlist of non-standard terms to avoid repeated false positives.
  • Check documentation, README files, and changelog entries for common spelling errors.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Codespell finds and fixes common misspellings in text files, particularly source code, using a curated dictionary of frequent errors rather than full dictionary validation.

Yes. Codespell is actively maintained, has zero known vulnerabilities, installs with no dependencies, and requires only Python 3.9+. It solves a real problem—catching typos in code and docs—with low friction and minimal false positives. The GPL-2.0-only license is copyleft; verify compatibility with your project before shipping it as a dependency, but using it locally as a development tool carries no license risk.

Install

codespell on PyPI

pip

pip install codespell

uv

uv add codespell

poetry

poetry add codespell

Installing codespell

Before you install

Low friction: pure Python wheel with no runtime dependencies. Active maintenance—last commit 2026-08-10, release 30 days ago. Supports Python 3.9 through 3.13.

License in practice

GPL-2.0-only (copyleft): you may use and modify codespell freely, but any derivative work or distribution must also be licensed under GPL-2.0-only. Check your project's license compatibility before integrating.

Quickstart

pip install codespell
codespell
codespell -w  # write changes to files
codespell -L word1,word2  # ignore specific words

Requires Python 3.9 or above.

Verify before relying

  • Whether the built-in dictionary covers domain-specific terminology relevant to your codebase.
  • Performance characteristics on very large codebases or repositories.

Package facts

License GPL-2.0-only (copyleft)
Python support supports the current Python release (>=3.9)
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance actively maintained — 30 days since the last release
Last repo commit
First released
Downloads 6,346,962/month — #1,924 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: codespell-2.4.3-py3-none-any.whl

Intended Audience :: DevelopersOperating System :: MacOSOperating System :: Microsoft :: WindowsOperating System :: POSIXOperating System :: UnixProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9Topic :: Software Development

Tags

spell check source codefix typos in filescommon misspelling detectorautomated spelling correctioncode quality spell checkerbatch typo findertext file spell check tool
spell-checkcode-qualityci-cd-ready

More Software Development packages