This list is an attempt to answer the question "What's the maximum string length for ...?" for as many strings as possible. Note that all numerical values are in bytes (not characters), unless stated otherwise. Also note that many of these numbers can be subject to change; don't hold me responsible if your software breaks.
- arbitrarily long
There is PATH_MAX
, but it is problematic, as paths might actually be longer than this limit in practice. See, for example, the articles PATH_MAX is tricky and PATH_MAX simply isn't.
255
For most file systems, anyway. See NAME_MAX
and the Wikipedia article on file system comparison.
255
Version 1.5 of the XLogical Font Description Conventions PDF says:
The entire font name string must have no more than 255 characters.
512
for the message8191
for tags
According to RFC-2812, an IRC message (that is, the actual chat message plus meta data, like prefix and parameters) is limited to 512 bytes, which includes the \r\n
, leaving 510 bytes for the message. With IRC v3, an IRC message can additionally contain tags, which can use up to 8191 bytes.
63
for each label253
for the entire domain
See this Wikipedia article or RFC-1034.
254
See this detailed Stack Overflow answer for background information, including why the limit is not 320, as often stated.
255
That's 127 for the type, 1 for the slash and another 127 for the subtype, according to RFC-4288. Note, however, that the more recent RFC-6838 states that both type and subtype should not exceed 64 characters each.
15
for IPv445
for IPv6
See this Stack Overflow question for IPv6; see INET_ADDRSTRLEN
and INET6_ADDRSTRLEN
for both, IPv4 and IPv6.
11
According to the answers on this relevant question on Stack Overflow.
25
According to a reddit post from 2015 and BarryCarlyon, both the user names (nicks) and display names on Twitch can not exceed 25 characters.
59
According to the Gamepedia Minecraft Wiki.
7
for RGB9
for RGBA
Easily determined: 2 bytes for each color channel, plus 1 byte for the #
character.