Convert emoji into text in Python

Last Updated : 9 Jan, 2026

Emojis are widely used in modern digital communication, but sometimes you may want to convert them into text for data processing, sentiment analysis, or cleaning text data. In Python, this can be easily done using the demoji module.

Installation

You can install the demoji module using pip:

pip install demoji

Note: The demoji module requires downloading the latest emoji codes from the Unicode Consortium, as the emoji list is frequently updated.

Python
import demoji
demoji.download_codes()

Using demoji to Convert Emojis into Text

Once the codes are downloaded, you can start converting emojis into descriptive text.

Example 1: Remove Emojis from Text

Python
import demoji

text = "Good morning! β˜€οΈπŸŒΈ"
a1 = demoji.replace(text, "")
print(a1)

Output:Β 

Good morning!

Example 2: Replace Emojis with Descriptive Text

Python
import demoji

text = "Happy birthday! πŸŽ‚πŸŽˆ"
a1 = demoji.replace_with_desc(text)
print(a1)

Output

Happy birthday! :birthday cake::balloon:

Example 3: Detect Emojis in a String

Python
import demoji
text = "Good morning β˜€οΈπŸ˜Š"
emojis = demoji.findall(text)
print(emojis)

Output:Β 

{'β˜€οΈ': 'sun', '😊': 'smiling face with smiling eyes'}

Example 4: Remove All Emojis from Text

Python
import demoji

text = "Welcome to the party! πŸŽ‰πŸ₯³"
a1 = demoji.replace(text, "")
print(a1)

Output:Β 

Welcome to the party!

Comment

Explore