49

There's one question in SO I'm planning to answer with a really long answer. While I'm still baking my post, these questions dawned to me:

  1. What is the maximum character length of a post?

  2. How many links can I include, at most?

  3. How about the number of images?

  4. What is the character limit on the question title?

  5. Do the limits on questions apply to answers as well, or do they have different ceilings?

2
  • 1
    Are you trying to do a really massive self-answered Q/A? – Mysticial Apr 14 '13 at 2:44
  • Nope, it's not a self-answered Q/A. It's an old question I stumbled upon, but doesn't have an accepted answer. – Ronixus Apr 14 '13 at 2:51
49

The maximum length of a post, question or answer, on Stack Overflow is 30,000 characters. This includes markdown and any other formatting. The limit on the question title is 150 characters.

I don't believe there are any upper limits on the number of links and images. I challenge you to make a post so heavy on links and images that we're tempted to add some. ;)

11
  • 5
    I 'd write a script to do that, pulling data from Google. :) I'm joking... Maybe we need a spammers stack. – beppe9000 Jan 9 '15 at 20:48
  • But in SEDE the title length is 250 and that limit seems to be reduced, as found out by a user on MSO where I provided this answer and the query I used the validate title length. – rene Sep 13 '15 at 14:12
  • 2
    Because it is interesting, I found that there are actually about 950 posts on Stack Overflow that are over this soft-limit of 30,000 characters, with the biggest being this answer, which is currently 53,383 characters long. Cross-reference soft-limit. – Bob Oct 10 '15 at 12:27
  • @rene I saw your MSO post about the title limits. Very interesting! I found an equally awkward situation with post bodies (see above comment). The datatype for post bodies in SEDE is nvarchar(max), 2GB worth of character data. Not sure if such posts can be edited without shortening them first. – Bob Oct 10 '15 at 12:58
  • @Bob keep in mind that SEDE isn't an exact copy of the production database so it is all more or less educated guessing and when blatantly wrong Adam will be the first to correct me. For posts.body you can't follow the same reasoning because what is stored is the html result after markdown parsing while the 30K limit is for raw markdown. The html is almost guaranteed to take more characters. However if you take the len(text) of the posthistory table for type 2 and 4 you'll find that the max=30K. The raw post body is stored there. – rene Oct 12 '15 at 18:39
  • 4
    "I don't believe there are any upper limits on the number of links and images" For users with less than 10 reputation there are limits, the limit is 2 links and no images. – Donald Duck Jun 7 '17 at 10:25
  • Is this still correct or has this changed ? Has the limit been changed since when the answer was posted ? – Sergiy Kolodyazhnyy Jan 20 '18 at 23:46
  • 1
    @SergiyKolodyazhnyy No changes I can think of off the top of my head. Why do you ask? – Adam Lear Jan 22 '18 at 18:16
  • @AdamLear I had this same question on another SE site, and an answer there pointed to this one, but it's been posted a few years ago. Just curious whether this information is still valid and if the answer on my SE site should be accepted. Besides, I typically write lengthy answers which involve python or shell scripts, as well, so I need to know the limits – Sergiy Kolodyazhnyy Jan 22 '18 at 18:19
  • 1
    @SergiyKolodyazhnyy Fair enough. Yeah, these should still be correct. – Adam Lear Jan 22 '18 at 18:21
  • 1
    Has anyone taken up the challenge yet? ("...make a post so heavy on links and images that we're tempted to add some") – Rebecca J. Stones Jan 4 '20 at 3:15
12

As was already answered, the limit on titles is 150 characters. We just released a new feature network-wide (including Stack Overflow for Teams) where users will be shown a character count starting when the Title hits 100 characters (this was originally requested by the Mathematics meta community in 2012…err…6-8 weeks ago).

The count will appear above the right end of the Title input box and will function in the same way as the character counter used elsewhere on the site (most prominently with comments):

Illustration showing the character counter both when approaching and after passing the character limit

When you go over the limit, an error state will show on the box. The character count will update as changes are made to the title. The counter will count actual text in the box (so if you are including something like LaTeX in the title, it will count the number of character before rendering it).

7
  • Why not just set maxlength="150" on the title textbox? – Shadow Wizard Wearing Mask V2 Mar 18 at 15:45
  • You say the limit is 150, but your image - apparently at 146 characters - says 11 characters left, which would be a limit of 157. – Mithical Mar 18 at 15:46
  • 1
    @Shadow I like this implementation, it feels more responsive than just capping and preventing input after x characters. This style is also consistent with how comment input length is capped/ tracked. – zcoop98 Mar 18 at 16:22
  • 1
    In a distant past, the title length limit used to be 250 characters, and there are still a number of questions whose titles are longer than 150 characters simply because they were allowed back when the last edit was saved. What will happen in this case: will the error immediately show up? – Sonic the Anonymous Hedgehog Mar 18 at 16:27
  • @Mithical count again please. source text if you don't believe me. – Yaakov Ellis Mar 18 at 16:38
  • 1
    @ShadowWizardisVaccinating if you try to edit the text on a legacy post with len(Title) > 150 then the edit will have to bring it under 150. We do not have code in their to allow the "too-long-title" status to be grandfathered in. – Yaakov Ellis Mar 18 at 16:39
  • 3
    Regarding maxlength, in addition to what @zcoop98 said about this being our convention elsewhere - we find it to be more friendly. Let the user type out all that they need, and if over, they can reduce the length. This is especially pertinent on sites like Math.SE (the originator of this request) where LaTeX in titles (where pre-render length can be much longer than post-render length) where users faced specific challenges in this area. – Yaakov Ellis Mar 18 at 16:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .