Many legacy platforms allow users to create and send custom emojis in place of the ones supported by Unicode, allowing users a wider range of expression when chatting. This specification provides a way for users to send custom emojis using a custom Message Markup (XEP-0394) [1] element containing Bits of Binary (XEP-0231) [4] data.
Implementations which support custom emoji markup MUST advertise 'urn:xmpp:markup:emoji:0' via Entity Capabilities (XEP-0115) [5] and Service Discovery (XEP-0030) [6].
To send a custom emoji, implementations use a custom <emoji /> element qualified with the 'urn:xmpp:markup:emoji:0' namespace inside a Message Markup (XEP-0394) [1] <span /> element as a child of a Message Markup (XEP-0394) [1] <markup /> element, with a media element (either Stateless file sharing (XEP-0447) [2] <file-sharing /> or Stateless Inline Media Sharing (XEP-0385) [3] <media-sharing />) as a sibling of the <markup /> element. The <span /> MUST contain a 'start' and 'end' range which marks the range of text to replace with the custom emoji. If the 'start' and 'end' contain the same index, the emoji MUST be inserted at that index without replacing any text. The <emoji /> MAY contain a 'name' attribute containing the name of the emoji, but it MUST include one or more Use of Cryptographic Hash Functions in XMPP (XEP-0300) [7] <hash /> elements to identify the specific emoji in one of the media elements.
<message from='romeo@montague.lit' to='juliet@shakespeare.lit' type='chat'>
<body>To be, or not to be, that is the question 🤔</body>
<markup xmlns='urn:xmpp:markup:0'>
<span start='42' end='43'>
<emoji xmlns='urn:xmpp:markup:emoji:0' name='pondering'>
<hash xmlns='urn:xmpp:hashes:2' algo='sha3-256'>ENeyvkxcfv8dmL4HBrF3JU1OX1BfpNV3YbhlEb20ReU=</hash>
</emoji>
</span>
</markup>
<file-sharing xmlns='urn:xmpp:sfs:0'>
<file xmlns='urn:xmpp:file:metadata:0'>
<media-type>image/png</media-type>
<name>pondering</name>
<size>6129</size>
<width>64</width>
<height>64</width>
<hash xmlns='urn:xmpp:hashes:2' algo='sha3-256'>ENeyvkxcfv8dmL4HBrF3JU1OX1BfpNV3YbhlEb20ReU=</hash>
<hash xmlns='urn:xmpp:hashes:2' algo='id-blake2b256'>QdJufo3MnaEPCK/2Q8fCiX3FutiQej6uHg5HaCliheY=</hash>
</file>
<sources>
<url-data xmlns='http://jabber.org/protocol/url-data' target='https://download.montague.lit/4a771ac1-f0b2-4a4a-9700-f2a26fa2bb67/pondering.png' />
</sources>
</file-sharing>
</message>
<message from='romeo@montague.lit' to='juliet@shakespeare.lit' type='chat'>
<body>Look at this funny image I found! :laughing: I wonder what it means? :pondering:</body>
<markup xmlns='urn:xmpp:markup:0'>
<span start='34' end='44'>
<emoji xmlns='urn:xmpp:markup:emoji:0' name='laughing'>
<hash xmlns='urn:xmpp:hashes:2' algo='sha3-256'>jMbLbIw1lfDhNVrE1wtB8C1R94OXKbyq/i8DUmHiHs8=</hash>
<hash xmlns='urn:xmpp:hashes:2' algo='id-blake2b256'>a5wIaBMtKT+Rs4TSc0C4ciWb5bmA3GCBv3xIUBxpKGA=</hash>
</emoji>
</span>
<span start='69' end='80'>
<emoji xmlns='urn:xmpp:markup:emoji:0' name='pondering'>
<hash xmlns='urn:xmpp:hashes:2' algo='sha3-256'>ENeyvkxcfv8dmL4HBrF3JU1OX1BfpNV3YbhlEb20ReU=</hash>
<hash xmlns='urn:xmpp:hashes:2' algo='id-blake2b256'>QdJufo3MnaEPCK/2Q8fCiX3FutiQej6uHg5HaCliheY=</hash>
</emoji>
</span>
</markup>
<file-sharing xmlns='urn:xmpp:sfs:0' id='emoji1'>
<file xmlns='urn:xmpp:file:metadata:0'>
<media-type>image/png</media-type>
<name>laughing</name>
<size>8391</size>
<width>64</width>
<height>64</width>
<hash xmlns='urn:xmpp:hashes:2' algo='sha3-256'>jMbLbIw1lfDhNVrE1wtB8C1R94OXKbyq/i8DUmHiHs8=</hash>
<hash xmlns='urn:xmpp:hashes:2' algo='id-blake2b256'>a5wIaBMtKT+Rs4TSc0C4ciWb5bmA3GCBv3xIUBxpKGA=</hash>
</file>
<sources>
<url-data xmlns='http://jabber.org/protocol/url-data' target='https://download.montague.lit/d51e8d71-98a3-4dd7-be64-cb4c778c90d2/laughing.png' />
</sources>
</file-sharing>
<file-sharing xmlns='urn:xmpp:sfs:0' id='emoji2'>
<file xmlns='urn:xmpp:file:metadata:0'>
<media-type>image/png</media-type>
<name>pondering</name>
<size>6129</size>
<width>64</width>
<height>64</width>
<hash xmlns='urn:xmpp:hashes:2' algo='sha3-256'>ENeyvkxcfv8dmL4HBrF3JU1OX1BfpNV3YbhlEb20ReU=</hash>
<hash xmlns='urn:xmpp:hashes:2' algo='id-blake2b256'>QdJufo3MnaEPCK/2Q8fCiX3FutiQej6uHg5HaCliheY=</hash>
</file>
<sources>
<url-data xmlns='http://jabber.org/protocol/url-data' target='https://download.montague.lit/16c8bc69-f4b2-4772-8db3-74fca5e2a275/pondering.png' />
</sources>
</file-sharing>
</message>Many custom emojis can be adequately represented in terms of an existing Unicode emoji. Clients might find it useful to allow users to optionally specify a replacement emoji, which will improve the experience of users of clients which do not support custom emojis, with the name/shortcode of the emoji used only as a fallback. However, this specification makes no recommendation on the fallback text an implementation opts to use.
Implementations SHOULD expect to handle animated emojis, such as GIFs or animated PNGs. This could include either playing the animation or displaying the first frame.
Implementations might receive a file type which they do not or cannot support, in which case they MAY opt to ignore the emoji markup altogether.
Implementations MAY use sticker packs in Stickers (XEP-0449) [8] for emojis too
Implementations SHOULD provide a proper fallback for custom emojis, as well as including the 'name' attribute. This helps both users of unsupported clients as well as users who may not be able to view the emoji properly.
Implementations MAY post-process the file for color deficiency, epilepsy, or other accessiblity reasons. This could include slowing down playback or changing the saturation.
Emojis are just media files. All the usual security risks of allowing users to send arbitrary media apply.
None.
This specification defines the 'urn:xmpp:markup:emoji:0' namespace.
TODO.
This document in other formats: XML PDF
This XMPP Extension Protocol is copyright © 1999 – 2024 by the XMPP Standards Foundation (XSF).
Permission is hereby granted, free of charge, to any person obtaining a copy of this specification (the "Specification"), to make use of the Specification without restriction, including without limitation the rights to implement the Specification in a software program, deploy the Specification in a network service, and copy, modify, merge, publish, translate, distribute, sublicense, or sell copies of the Specification, and to permit persons to whom the Specification is furnished to do so, subject to the condition that the foregoing copyright notice and this permission notice shall be included in all copies or substantial portions of the Specification. Unless separate permission is granted, modified works that are redistributed shall not contain misleading information regarding the authors, title, number, or publisher of the Specification, and shall not claim endorsement of the modified works by the authors, any organization or project to which the authors belong, or the XMPP Standards Foundation.
## NOTE WELL: This Specification is provided on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. ##
In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall the XMPP Standards Foundation or any author of this Specification be liable for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising from, out of, or in connection with the Specification or the implementation, deployment, or other use of the Specification (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if the XMPP Standards Foundation or such author has been advised of the possibility of such damages.
This XMPP Extension Protocol has been contributed in full conformance with the XSF's Intellectual Property Rights Policy (a copy of which can be found at <https://xmpp.org/about/xsf/ipr-policy> or obtained by writing to XMPP Standards Foundation, P.O. Box 787, Parker, CO 80134 USA).
The HTML representation (you are looking at) is maintained by the XSF. It is based on the YAML CSS Framework, which is licensed under the terms of the CC-BY-SA 2.0 license.
The Extensible Messaging and Presence Protocol (XMPP) is defined in the XMPP Core (RFC 6120) and XMPP IM (RFC 6121) specifications contributed by the XMPP Standards Foundation to the Internet Standards Process, which is managed by the Internet Engineering Task Force in accordance with RFC 2026. Any protocol defined in this document has been developed outside the Internet Standards Process and is to be understood as an extension to XMPP rather than as an evolution, development, or modification of XMPP itself.
The primary venue for discussion of XMPP Extension Protocols is the <standards@xmpp.org> discussion list.
Discussion on other xmpp.org discussion lists might also be appropriate; see <https://xmpp.org/community/> for a complete list.
Errata can be sent to <editor@xmpp.org>.
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.
1. XEP-0394: Message Markup <https://xmpp.org/extensions/xep-0394.html>.
2. XEP-0447: Stateless file sharing <https://xmpp.org/extensions/xep-0447.html>.
3. XEP-0385: Stateless Inline Media Sharing (SIMS) <https://xmpp.org/extensions/xep-0385.html>.
4. XEP-0231: Bits of Binary <https://xmpp.org/extensions/xep-0231.html>.
5. XEP-0115: Entity Capabilities <https://xmpp.org/extensions/xep-0115.html>.
6. XEP-0030: Service Discovery <https://xmpp.org/extensions/xep-0030.html>.
7. XEP-0300: Use of Cryptographic Hash Functions in XMPP <https://xmpp.org/extensions/xep-0300.html>.
8. XEP-0449: Stickers <https://xmpp.org/extensions/xep-0449.html>.
Note: Older versions of this specification might be available at https://xmpp.org/extensions/attic/
Changed the id attribute to refer to the first hash of the media element. Removed packs
Added emoji packs, and switched to using SFS instead of just BoB
First draft.
@report{guckfung2026xepxxxx,
title = {Emoji Markup},
author = {Guckfung, Snit and Einarsson, Sigrid},
type = {XEP},
number = {xxxx},
version = {0.0.3},
institution = {XMPP Standards Foundation},
url = {https://xmpp.org/extensions/xep-xxxx.html},
date = {2026-03-08/2026-04-05},
}END