On this page
Overview
Twemoji combines a JavaScript parser with a shared emoji artwork set so Unicode emoji can render consistently across platforms. It can scan text nodes in the DOM and replace emoji with images while allowing PNG or SVG assets, custom base URLs, class names, and related options. The master package metadata and README report 14.0.3 and target Emoji 14.0 RGI emoji.
Features and best fit
Based on official documentation; not hands-on tested · Content checked:
Key features
Replace Unicode emoji in DOM text nodes while preserving surrounding elements
twemoji.parse(element) replaces emoji found in text nodes with images without replacing surrounding DOM nodes or listeners. The README recommends DOM parsing when security is a primary concern.
Sources: [2]
Choose PNG or SVG assets and control where they are served from
Options such as base, size, folder, and ext let applications use self-hosted assets or another CDN and select PNG or SVG output. Class names and callbacks are also customizable.
Sources: [2]
Best fit
Fits web interfaces that need the same emoji artwork regardless of operating system or browser
It is useful for chat, support, social, and other interfaces where native emoji fonts would otherwise render differently for each user.
Sources: [2]
Before adoption
The graphics are CC BY 4.0 rather than MIT and require attribution
The JavaScript code is MIT-licensed, but the emoji artwork is licensed under CC BY 4.0. Applications distributing or displaying the graphics should follow the attribution requirements described in the README and graphics license, such as an About page, footer, or project README.
Revisit string parsing and version or CDN assumptions
The README discourages string parsing because it does not sanitize input and recommends DOM parsing instead. The former MaxCDN endpoint is no longer available, with master pointing to unpkg or downloaded assets. GitHub's latest release is v14.0.2, while master package metadata and the README report 14.0.3.
Official sources
- [1]twitter/twemoji repository(2026-09-30)
- [2]Twemoji README(2026-09-30)
- [3]Twemoji package metadata(2026-09-30)
- [4]Twemoji v14.0.2 GitHub release(2026-09-30)
- [5]Twemoji code MIT license(2026-09-30)
- [6]Twemoji graphics CC BY 4.0 license(2026-09-30)
Supplemental curator note
Twemoji removes operating-system differences in emoji artwork, but its graphics carry CC BY 4.0 attribution requirements. Adoption should account for the artwork license in addition to the MIT license covering the JavaScript code.
Try it in 3 steps
- 1
Install Twemoji 14.0.3
Pin the version reported by the current master package metadata and README.
npm install twemoji@14.0.3 - 2
Import the DOM parser
Use DOM parsing as recommended by the README because string parsing does not sanitize its input.
import twemoji from 'twemoji'; - 3
Replace emoji in the document
Convert Unicode emoji inside text nodes to image elements. In production, also configure asset hosting and the CC BY 4.0 attribution for the graphics.
twemoji.parse(document.body);
Growth
Growth trends · Last 30 days
17,794 Stars
Trend data is still being collected.
Built with
Categories and tags
Categories
GitHub data
GitHub dataView detailed GitHub data
GitHub Topics
- emoji
- twemoji
Related information
Write a related articleShare a guide or use case for this OSS in Markdown. Articles are published after administrator approval.
Explore next
- Expo52,500 Stars
2 shared tag(s) · 1 shared category(s)
build React Native apps for Android, iOS, and web from one project model
TypeScript - WXT10,556 Stars
2 shared tag(s) · 1 shared category(s)
build Chrome and Firefox extensions with file-based entrypoints and an HMR development workflow
TypeScript - vanilla-extract10,435 Stars
2 shared tag(s) · 1 shared category(s)
write type-safe styles in TypeScript and extract them to static CSS at build time
TypeScript - Thymeleaf2,983 Stars
2 shared tag(s) · 1 shared category(s)
connect HTML-like templates to Java server-side rendering
Java - React250,838 Stars
2 shared tag(s)
build web and native interfaces from declarative components
JavaScript - Storybook91,178 Stars
2 shared tag(s)
capture UI states once and reuse them across docs, interaction tests, and agent tooling
TypeScript
Report incorrect information
Tell us if any listing information is incorrect or outdated.