What is the character limit for web push notifications?

Are you wondering what is the maximum length of text that you can include in your web notifications?

In general the standard doesn’t set a limit for the notification fields. So you won’t find any limit defined in the Web Notifications API.

The only practical limit is on the entire payload, whose maximum size is usually defined by the push service (e.g. Google Firebase, Mozilla Autopush, Apple Push Notification service, Windows Push Notification Services). In order to avoid issues, your payload (including both the JSON and the actual values) must stay below the 3kB. For Pushpad we have been using this limit for years and we never had problems with the notification delivery.

However the browser, when displays the notification, can decide to truncate the text at an arbitrary length if it is too long. This varies a lot between different browsers, versions, operating systems and themes. It can also vary over time without notice, since it is not regulated by a standard. Finally the length also varies based on the actual contents of the notification: for example, if the notification has a large image, the text displayed might be shorter.

If you want to check the maximum length of the web push notifications on a given browser / OS, you can simply test it yourself: open your favorite browser and use this demo to send a long message… You will see how many characters are actually displayed by the browser.

In order to save you time we have already made some experiments with the most common browsers. Note that if you exceed the following limits, the notification is still displayed, but the notification text will be truncated. Here’s the results:

Browser / OSMax Title LengthMax Message LengthExpanded Message Length
Safari / MacOS30104120
Chrome / MacOS363967
Firefox / MacOS363967
Chrome / Android3945470
Chrome / Windows39175
Firefox / Windows53200

Leave a Reply

Your email address will not be published. Required fields are marked *