Skip Navigation
InitialsDiceBearhttps://github.com/dicebear/dicebearhttps://creativecommons.org/publicdomain/zero/1.0/„Initials” (https://github.com/dicebear/dicebear) by „DiceBear”, licensed under „CC0 1.0” (https://creativecommons.org/publicdomain/zero/1.0/)LS
Lemmy Support @lemmy.ml

What is the maximum username length for a Lemmy account?

Solution

The Lemmy server appears to have a database limit of 255 characters [2]; however, individual instances appear to put their own limits on username length though the frontend [3] and/or the API [4.1][4.2].

Original Post

If you know, please also provide relevant documentation.

UPDATE (2025-02-02T06:06Z): I did some brute-force testing, and, at least for sh.itjust.works, it seems that the maximum username length is 50, and the maximum password length is 60 [1].


You're viewing a single thread.

51 comments
  • It seems to be set per-instance - you can find out through their APIs:

    curl -L http://lemmy.world/api/v3/site | jq -r .site_view.local_site.actor_name_max_length (26)

    curl -L http://sh.itjust.works/api/v3/site | jq -r .site_view.local_site.actor_name_max_length (50)

    • Is there any official documentation for that? Lemmy's API docs [1] seem rather sparse on the subject.

      UPDATE (2025-02-02T23:23Z): I found this [2] and this [3], but unfortunately it doesn't contain much information.

      • Not much. I think Lemmy's current API docs are generated from the JS client. So I guess there's

        https://join-lemmy.org/lemmy-js-client-docs/v0.19/interfaces/LocalSite.html#actor_name_max_length

        This refers to the wrong line number though, it's actually at:

        https://github.com/LemmyNet/lemmy-js-client/blob/ad9f402e06292899a35927c46fe48b22c6f5eb27/src/types/LocalSite.ts#L59

        • Is it known for sure that name is the username? Could it be the display name? In the ActivityPub spec, I found this [1]:

          name

          The preferred "nickname" or "display name" of the actor.

          • I'm not used to this level of rigour to be honest. You've accepted your own unscientific prodding of one particular instance as an answer, and one link to a years-old migration as a answer, but I give you reproducible command-line instructions, which match up with your own findings, and it's apparently not good enough.

            Anyway, as that migration shows, Lemmy distinguishes between 'name' for username, and 'display_name' for the display name. A better link for this is arguably https://github.com/LemmyNet/lemmy/blob/main/crates/db_schema/src/schema.rs#L735 but whatever. It's these fields that are relevant to Lemmy's API, not the terminology that ActivityPub uses. A client might reasonably want to know the limit for a username (as provided in the Site response), because it's this that's used for Signup and Login. Display name is set elsewhere, once that's done, so it doesn't make sense for actor_name_max_length to refer to this.

            Within ActivityPub, the distinction between username and display name is 'preferredUsername' and 'name', but AP also uses 'name' for a bunch of other things (including but not limited to what becomes a post title, a choice in a poll, or the alt-text for an image). There's some overlap with how Lemmy's API refers to stuff (e.g. a post title is a post name), but it not a 1:1 match.

            I hope this is enough. I don't even use Lemmy, so - in my opinion - you're asking the wrong question to the wrong person. What you should be asking, is - "How come when I post a question to Lemmy's support community, on the instance owned by Lemmy devs, it looks like they just ignore it?". You shouldn't have to be relying on guesswork by amateurs, irrespective of how many 'references' they can quote.

            • […] It’s these fields that are relevant to Lemmy’s API, not the terminology that ActivityPub uses. […]

              Fair point! I was incorrectly assuming that Lemmy's terminology directly matched that of ActivityPub.

            • […] Lemmy distinguishes between ‘name’ for username, and ‘display_name’ for the display name. A better link for this is arguably https://github.com/LemmyNet/lemmy/blob/main/crates/db_schema/src/schema.rs#L735 but whatever. It’s these fields that are relevant to Lemmy’s API, not the terminology that ActivityPub uses. A client might reasonably want to know the limit for a username (as provided in the Site response), because it’s this that’s used for Signup and Login. Display name is set elsewhere, once that’s done, so it doesn’t make sense for actor_name_max_length to refer to this.

              Within ActivityPub, the distinction between username and display name is ‘preferredUsername’ and ‘name’, but AP also uses ‘name’ for a bunch of other things (including but not limited to what becomes a post title, a choice in a poll, or the alt-text for an image). There’s some overlap with how Lemmy’s API refers to stuff (e.g. a post title is a post name), but it not a 1:1 match. […]

              Thank you for providing this information.

            • […] You shouldn’t have to be relying on guesswork by amateurs, irrespective of how many ‘references’ they can quote.

              I think you are misunderstanding how I am using references. They are only being used to point to the origin of a bit of knowledge. Their existence does not guarantee any level of accuracy.

              • I think the way you were using references started to wind me up. It gave some academic veneer to a format that usually more conversational. They're just links to what some people reckon, but dressed up with 'accessed' and 'published' in a footnote format that in other other contexts would suggest a level of credibility that they don't have. Either something is solved or it isn't, but it shouldn't be marked 'solved' with links to answers of questionable accuracy.

                • […] Either something is solved or it isn’t, but it shouldn’t be marked ‘solved’ with links to answers of questionable accuracy.

                  This is a fair point, I think. Do you propose an alternative word? At what point would you say that it is justified to use "solved"? I used "solved" because, for my purposes, the question is answered (I know now that SJW has a max username length of 50, which is the only information that I personally needed).

                  • I don't know. I'm still hung up about this 'references' thing, I think. It reads like you intend for your post to be an objective resource for others to use, but then fall back to it being good enough for your subjective purpose when questioned about it.

                    It feels like wanting to have your cake and eat it - a authoritative-looking post that isn't authoritative.

                    • […] a authoritative-looking post […]

                      What do you mean by this exactly? Is it synonymous with your usage of "objective resource"?

                    • It reads like you intend for your post to be an objective resource for others to use, but then fall back to it being good enough for your subjective purpose when questioned about it.

                      First, what do you exactly mean by "objective resource"? Second, what makes you think that it's intended to be an "objective resource"? Are you saying that my use of citations gives you that impression?

                • […] They’re just links to what some people reckon, but dressed up with ‘accessed’ and ‘published’ in a footnote format that in other other contexts would suggest a level of credibility that they don’t have. […]

                  This may be how you are interpreting it, but I assure you that isn't how I am using it. I personally try to make that clear through the language that I pair with it. For example my usage of the word "appears" in the post suggests, imo, that something is likely, but not necessarily factual given the current body of evidence (as provided by sources), but it carries potential of being incorrect. I recognize that my understanding of things may be flawed, so I leave a sort of "trail of breadcrumbs" to where I found information for others (like yourself) to verify and/or dispute.

                • […] It gave some academic veneer to a format that usually more conversational. […]

                  I would argue that this is argument is moot given that this community, or at the very least this post, isn't exactly the place for casual conversation, as it is a support community.

            • […] What you should be asking, is - “How come when I post a question to Lemmy’s support community, on the instance owned by Lemmy devs, it looks like they just ignore it?”. […]

              I have no reason to expect any obligatory answer from anybody. IMO, it would be very entitled of me, or anyone else, to expect otherwise.

              • Is it? Maybe. If I was using software, and asked a question that the developers of it could easily answer, and they didn't, I might think about using something else. It certainly would've helped though, if you'd got an answer from someone you were more ready to believe.

                • […] It certainly would’ve helped though, if you’d got an answer from someone you were more ready to believe.

                  Believing a Lemmy developer's claim simply because they are a developer of Lemmy is an appeal to authority, imo. I would still ask for some documentation as proof, or for them to point to functionality within the code, or similar.

                • […] If I was using software, and asked a question that the developers of it could easily answer, and they didn’t, I might think about using something else. […]

                  There is no contractual obligation for the Lemmy developers to provide me with any service [1]. I would agree insofar that I think that there is some level of advertisement provided by their behavior towards their base, but I personally don't feel entitled to anything. Of course, this is just my personal opinion.

            • […] I don’t even use Lemmy, so - in my opinion - you’re asking the wrong question to the wrong person. […]

              I don't know you, so how would I know what your level of expertise is regarding Lemmy? You are the one that commented on my post...

              • I think you can be an outsider to a particular system, and still be able to provide valuable information about it. Enough to be able to satisfy your own curiosity, and hopefully someone else's too. I can imagine a version of this post where you asked what the max username length was, I gave you a means to find out, and we both went on our way. So you can be 'right person' to comment on a post, but the 'wrong person' when it turns out that your answer isn't going to be fully accepted without digging into someone else's source code. As for who the right person is in that case, there's some overlap with your comment about 'entitlement', so I'll continue there.

                • I think you can be an outsider to a particular system, and still be able to provide valuable information about it. […]

                  I completely agree! It is also illogical to argue otherwise ­— sort of an appeal to authority, imo.

                  For clarity, I wasn't claiming that you were incorrect due to your self-professed insufficient level of expertise. I was simply responding to your argument that "it's silly to ask you for advice because you don't use Lemmy" by arguing that your premise is unjustified — your argument is valid; however, I don't think that it's sound. I interpret your logic as follows:

                  1. (By your argument) If one is inexperienced with Lemmy, then it is unwise to ask their opinion.
                  2. You claimed that you are inexperienced with Lemmy.
                  3. Therefore, it is unwise to ask you for your opinion.

                  This is a valid argument, as it follows by modus ponens; however, it is unsound, as the premise is not epistemologically justified, as I cannot know, pior to you telling me, what your experience is with Lemmy. Hence why I said:

                  I don’t know you, so how would I know what your level of expertise is regarding Lemmy?

                  • it's silly to ask you for advice because you don't use Lemmy

                    That was never my argument. I think you know this.

                    Being reluctant to answer any more questions about a topic doesn't mean I was wrong to provide an initial answer. It just means my bandwidth has been exceeded. If Lemmy was a project I was invested in, and I didn't think your second follow-up question was disingenuous, then it would've been different, but as things were, I resented being given homework about it.

                    • If […] I didn’t think your second follow-up question was disingenuous […]

                      For clarity, it wasn't intended to be disingenuous. I apologize if I gave you that impression. I'm always trying to improve how I interact with others.

                    • That was never my argument. I think you know this. […] Being reluctant to answer any more questions about a topic doesn’t mean I was wrong to provide an initial answer. It just means my bandwidth has been exceeded. […]

                      Perhaps I misunderstood you. When I read this:

                      I don’t even use Lemmy, so - in my opinion - you’re asking the wrong question to the wrong person.

                      I interpreted it to litterally mean that I shouldn't ask you questions about Lemmy because you don't use it. I interpret your statement that you don't use Lemmy to mean that you are less likely to have knowledge about Lemmy because you don't use it.

                      At any rate, this is moot, as I mentioned above that I cannot know, prior to you telling me, what your experience is. And furthermore, I didn't ask you anything. You volunteered an answer.

            • […] I give you reproducible command-line instructions, which match up with your own findings, and it’s apparently not good enough. […]

              Did you perhaps not see that I cited your comment's findings as a source for the solution...? Or is it that you can't believe that I would dare to exhibit any amount of skepticism of your claim?

              • I saw your edit, yeah. I'm not some precious person who thinks no-one should dare question their claims. To my mind, though, what I said wasn't a claim. A claim would be if I'd said "lemmy.world is 26, sh.itjustworks is 50" with no further info. Instead, I gave command-line instructions for you to run yourself, so you could get the answers for those instances (and any other instances) from Lemmy's backend itself. If I wasn't reasonably sure that the backend was giving you the numbers you were looking for, I wouldn't have mentioned it.

                I wasn't reacting to being questioned, though, I was reacting to being singled-out for being questioned. You marked this as "Solved" based - also - on a test from you, and an answer from TootSweet, but it didn't look like to me that you ever questioned whether those answers deserved a follow-up. Neither of those, in my opinion, are really good enough, but I'll say why in the answers to your individual comments about them.

                • […] I wasn’t reacting to being questioned, though, I was reacting to being singled-out for being questioned. You marked this as “Solved” based - also - on a test from you, and an answer from TootSweet, but it didn’t look like to me that you ever questioned whether those answers deserved a follow-up. Neither of those, in my opinion, are really good enough, but I’ll say why in the answers to your individual comments about them.

                  This isn't to discredit how you have internalized the exchange, so I apologize if I made you feel this way, but I want to assure you that it wasn't my intent to single you out. I was simply looking for clarification because I felt that I might've found a potential ambiguity that I personally wasn't sure of.

                • […] To my mind, though, what I said wasn’t a claim. A claim would be if I’d said “lemmy.world is 26, sh.itjustworks is 50” with no further info. Instead, I gave command-line instructions for you to run yourself, so you could get the answers for those instances (and any other instances) from Lemmy’s backend itself. […]

                  Eh, this is becoming rather pedantic, imo. I'm not sure what point you are trying to make.

                  • I made one arsey comment, and you replied to it 9 times. It was only ever going to get pedantic. It's too late to complain about it now.

                    • […] you replied to it 9 times. […]

                      I personally try to keep my responses atomic to the topic.

                    • […] It’s too late to complain about it now.

                      I'm not complaining, I just didn't understand what the point was that you were trying to make.

                • I saw your edit, yeah. […]

                  Then what is it about me using your comment as a source makes you think that I viewed your response as "not good enough"?

                  • Nothing. It wasn't about the edit.

                    I've said elsewhere that I thought your second follow-up question was disingenuous, so I'll expand on that here. That's the thing that annoyed me. Not because I think no-one should question me, or because no-one should inquire further, but because the more questions you want to ask about a particular thing, the more informed those questions need to be. Otherwise it just gets tedious, explaining why irrelevant things are irrelevant. User display names aren't relevant to an API's '/site' response; ActivityPub isn't relevant at all, and 'name' is such a generic, widely-used word, that reaching for it as evidence that I might be confused is such a stretch, I don't know why you'd go for it. It made me question your motive, given that the likelihood of you being correct - after fishing a word out from something you don't seem that experienced with - is so low. It stops reading as a well-intentioned question, and starts reading as scepticism for scepticism's sake.

                    • […] reaching for it as evidence that I might be confused is such a stretch […]

                      I suspect this statement is the source of all of this. When I sent this comment, I wasn't trying to do some "gotcha". I thought we were, in a sense, investigating together through documentation to try an find the right answer to the question. From my perspective, you provided an idea of what it could be, and I was trying to work with you to narrow down if that was for sure what we were looking for by providing some documentation that I came across. I wasn't trying to insult your intelligence, or belittle you or your help. I simply thought we were brainstorming together.

            • You’ve accepted […] one link to a years-old migration as [an] answer,

              […] as that migration shows […]

              I'm not sure what you are referring by "migration". Could you clarify?

              • TootSweet's link was to a migration. A migration is used to upgrade a database's schema - changing the limit on username length from whatever it was, to 255. As it happens, it's still 255 now, but an upgrade from 3 years ago isn't a good source for that, because as they themselves said, there could very well have been been upgrades since, that further changed the limit.

            • […] You’ve accepted your own unscientific prodding of one particular instance as an answer […]

              What exactly do you think is unscientific about it?

              • I used 'unscientific' because it would be a pain in the arse for someone else to reproduce, it only applies to one instance, it's a test on someone else's in-production system that you have no control over, and the error that returns isn't necessarily from the backend. It looks more like a Form Validation error (i.e. from the frontend). It's perfectly possible to create a frontend that puts it's own limits on username length, and there's some that no doubt already exist, so a brute-force test of those limits isn't telling you anything reliable about what Lemmy's internal limits are.

                • […] It’s perfectly possible to create a frontend that puts it’s own limits on username length, and there’s some that no doubt already exist, so a brute-force test of those limits isn’t telling you anything reliable about what Lemmy’s internal limits are.

                  I don't dispute your concern; however, for my needs, in all practical purposes, if the frontend did place its own unique restrictions on the username length, it wouldn't matter, as the uncertainty of the length of the username when creating an account through the frontend is why I created this post.

                  That being said, I think it's worth distinguishing between the two (API and frontend) in the solution section of my post. I will update it.

                • I used ‘unscientific’ because it would be a pain in the arse for someone else to reproduce […]

                  This is obviously an argument of definitions, but, at any rate, I disagree that a qualification for something to be scientific is that it must be easily reproducible; for something to be scientific it simply simply must be reproducible [1[2[3]]].

                • Hm, I think what's confusing things a bit in this conversation is that my original question is a bit of an XY problem — I asked about the maximum username length of a Lemmy account, yet I was, in reality, looking for the username length limits imposed by my instance (the answer for one instance may or may not apply to other instances). So that's my fault for not being accurate/clear enough in my initial question.

            • I’m not used to this level of rigour to be honest. […]

              In my opinion, one should always be open to scrutiny of their claims. One should strive to be precise in their communication — ie one should seek to rectify any uncertainties, ambiguities etc.

51 comments