demoji
Accurately remove and replace emojis in text strings
What it is and what it does
demoji is a text-processing library that accurately identifies and manipulates emojis in strings. It bundles Unicode Consortium emoji data at install time, so it works offline and requires no network access at runtime. The package handles complex emoji sequences—like skin-tone modifiers, zero-width joiners, and flag combinations—by sorting emoji codes by length and using a greedy regex approach to match longer sequences before shorter ones.
You can use it to find all emojis in a string and get their descriptions, extract emojis as a list, replace them with plain text, or convert them to colon-delimited codes (like `:fire:` for 🔥). It also provides a command-line interface for batch processing files or stdin. The library is typed, actively maintained, and supports modern Python versions.
Use it for:
- Clean user-generated content (tweets, comments, chat) by replacing emojis with text descriptions for downstream NLP or storage.
- Extract and catalog emojis from social media feeds or message logs to understand sentiment or trending symbols.
- Convert emoji-heavy text to plain ASCII for systems that don't render emoji or for accessibility.
- Validate or audit text fields in forms or databases to detect and flag emoji usage.
- Build emoji-aware text search or indexing by mapping emojis to their semantic descriptions.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
demoji finds and removes emojis from text, mapping each emoji to its Unicode description or replacing it with a plain-text equivalent.
Yes. demoji is lightweight, dependency-free, actively maintained, and solves a real problem with high accuracy. It handles edge cases (multi-character sequences, skin tones, flags) correctly and works offline. Use it whenever you need to find, extract, or normalize emojis in text.
Install
demoji on PyPI
pip
pip install demojiuv
uv add demojipoetry
poetry add demojiInstalling demoji
Before you install
Low friction: pure Python wheel with no runtime dependencies. Actively maintained, last commit 2026-07-12, with Unicode emoji data bundled at install time so no network calls are needed at runtime.
License in practice
Apache-2.0 is permissive; you can use demoji freely in commercial and private projects with minimal restrictions.
Quickstart
pip install demoji
import demoji
text = "Great game! 🔥 🎉"
print(demoji.findall(text))
# {'🔥': 'fire', '🎉': 'party popper'}
print(demoji.replace_with_desc(text))
# Great game! :fire: :party popper:
Requires Python 3.10 or later (supports 3.10–3.14).
Verify before relying
- Whether the bundled Unicode emoji data (version 16.0) can be updated independently of package releases.
- Performance characteristics when processing very large text blobs or documents with thousands of emojis.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (<3.15,>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 117 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 338,151/month — #7,436 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: demoji-2.0.0-py3-none-any.whl
Keywords: emoji, emojis, nlp, natural language processing, unicode
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
ecojiEncodes and decodes binary data as sequences of…
permissive · top 15,000 on PyPI
emotExtracts emojis and emoticons from text,…
unclear · top 15,000 on PyPI
emojiConverts between emoji characters and their…
permissive · top 1,000 on PyPI
anyasciiConverts Unicode text to ASCII-only equivalents…
permissive · top 5,000 on PyPI
strip-ansiRemoves ANSI escape sequences (color codes,…
unclear · top 15,000 on PyPI
graphemeProvides string manipulation functions that…
permissive · top 5,000 on PyPI
graphemeuProvides string manipulation functions that…
permissive · top 5,000 on PyPI
pytest-emojiAdds emoji indicators to pytest test result…
permissive · top 15,000 on PyPI
emoji-country-flagConverts between flag emoji and ASCII country…
permissive · top 15,000 on PyPI