A good title helps your question get the attention it deserves. What goes into a good title?
1. Make the topic stand out.
The purpose of a title is to attract people interested in your topic or who can give you an answer. People scan web pages quickly; make it easy for them to notice your question and understand what your question is about. Also keep in mind that some people may read questions via the RSS feed (Stack Overflow example), so they won't see tags.
2. Make it descriptive, but also to the point.
Make sure you describe your question or problem well enough so that readers get the gist of what it's about ("Problem with Java function" is not very descriptive). However, don't put every detail in your title... that's what the question body is for. Make your title descriptive, but also succinct.
For example, these articles discuss how people read web pages, based on using an eye tracking system to monitor users. For Stack Overflow-like pages, people read most of the first and second entries (the bars of the "F"), and then scan down the rest of the list, reading on average the first 16 characters of each line.
3. Use proper grammar and write in question form.
Make sure you spell words completely and correctly, and form your titles in a way that they make sense to people reading them.
4. Don't sweat replicating a tag keyword—if necessary.
The tags are orthogonal to the title. You may have to describe a part of your title using words that are already applied from your tags in order to distinguish your question from others and avoid confusion/ambiguity.
However, don't explicitly add tags to the title for their own sake. For example, don't start your title with a tag. See this post for a more detailed discussion of the relationship between tags and titles.
Some Good Examples
Here are some good titles, taken from the highest scoring posts across top sites.
Each of these summarizes the question adequately without introduce fluff or unnecessary verbiage, and, critically, provide context for exactly what the asker's question will be.
(Note that some questions are from very topic-specific sites like Ask Ubuntu or Physics)
- Why is it faster to process a sorted array than an unsorted array?
- Can I compute the mass of a coin based on the sound of its fall?
- What is the cURL command-line syntax to do a POST request?
- How do I undo the most recent commits in Git?
- Is there a correct gender-neutral singular pronoun (“his” vs. “her” vs. “their”)?
- How to unzip a zip file from the Terminal?
- How do I install a .deb file via the command line?
- How to determine if a bash variable is empty?
- Why don't metals bond when touched together?
- How do I deal with a compromised server?
- In what order should the Star Wars movies be watched?
- How to get bash or ssh into a running container in background mode?
- How does IPv4 Subnetting Work?
- How to upgrade a single package using apt-get?
Some Bad Examples
These titles, also taken from existing, poorly scored posts, are constructed of fragments, don't describe anything about the question, or lack useful context for what the asker's question actually is:
- Please help me!
- Python : Need Help About Statistics
- PostgreSQL encrypted backups
- Why it works like this?
- About Computer Architecture
- Constructing images using HTML markup?
- DNS resolvation of a URL
- Combine letter and numbers
- PHP - Passing variables
- BackgroundImage in css
- Map Routing, a la Google Maps?
- MySQL - Error In SQL Syntax
- I can t write in pascal expression
- 64-bit XML-RPC values?
- Turning Linux USB power on and off?
5. Finally, be flexible
Different questions benefit from different styles of titles. Applying any single hard and fast rule is probably a mistake.
While this is overall an excellent set of advice, I have some issues with a few of the titles:
- Oracle: formatting number as xxx-xx-xxxx
- Linux USB: turning the power on and off?
- Oracle: how to UPSERT (update or insert into a table)?
- Python: What OS am I running on?
- X11: raise an existing window via command line?
- XML-RPC: best way to handle 64-bit values?
- X11: move an existing window via command line?
- SQL: sum 3 columns when one column has a null value?
- Oracle: best way to search over a range of values?
- HTML: Constructing images using markup?
- Postgresql: Inserting BLOBs at a high-rate?
I am not sure the rigid format
Tag: Question Title
Is a good one. The starts-with-tag-colon convention is a bit artificial and should be tweaked. Here's what I'd rather see:
- formatting number as xxx-xx-xxxx in Oracle?
- turning the USB power on and off in Linux?
- how to UPSERT in Oracle?
- raise an existing X11 window via command line?
- best way to handle 64-bit values in XML-RPC?
- move an existing X11 window via command line?
- sum 3 columns in SQL when one column has a null value?
- Best way to search over a range of values in Oracle?
- Constructing images using HTML markup?
- Inserting BLOBs at a high-rate in PostgreSQL?
- What OS am I running on? (tagged Python)
(obviously all these questions would also be tagged with the right keywords)
To be clear, I think it is fine to duplicate the tags in the title, but only when they can be worked into the titles organically and conversationally.
If we're ritualistically appending tags to the front of the title, that doesn't feel like a tremendous improvement over a bunch of "How do I..." titles in the system, to me.
Your title should be, in order of greatest to least importance:
- Searchable. The point of Stack Exchange is not only to help the asker, but to others who may have the same problem as well in the future.
- Descriptive. A searcher would like to know whether the question is another one of those "How to write a HTML regex parser?" questions or actually the "Why is parsing HTML with regexes a bad idea?" they are looking for.
- Short. Put your 10-page essay in the post, not the title.
- Precise. Tell us in
- as few words as possible
- as much as possible.
- Interesting. How else will you make the Hot Questions list?
These points go together hand in hand. For example, a short and descriptive title is always searchable.
Your title should not be/contain:
- Programming language names. I do not need to see "How to fly using Python?". I can just check the tags for the python. This is redundant information which just takes up ~20% extra of the question title. Additionally, Google search results already say "python - How to fly?"
- Funny. Try not to be funny just for the sake of being funny. I am guilty of this too. If you excuse me, I will go have a serious conversation with Mr. Struct.
- "Is this code OK?" If your question wasn't about code, you wouldn't be posting it here!
- "Help with programming problem" This tells us nothing that we couldn't infer from the very fact that you're posting here.
- "Help with homework problem plz" But fortunately, certain keywords are automatically rejected.
Single word requests, crosswords, and the fight against mediocrity
RegEx match open tags except XHTML self-contained tags
Why is subtracting these two epoch-milli Times (in year 1927) giving a strange result?
Is it possible to serve HTML pages with ServiceStack?
How to deep copy an irregular 2D array
How Should Titles Be Capitalized?
Do I have to free an array inside a struct?
How to use a struct in C?
C Programming. How to deep copy a struct?
How do you make a deep copy of an object? (Any question containing the word 'Java' should be deleted, and its asker banned.)
(Jeff raises some good points. This is a followup to his note, since I can't edit his post, and I need a bit more formatting that what a comment provides.)
- Absolutely correct about rigidly adhering to a formula for titles. Do what makes sense.
I didn't realize I had picked so many topic: lines. There are certainly other ways to write good questions.
Many of Jeff's alternative are fine titles when considered in isolation.
However, if you want people to pick out your post from a list of other titles all competing for reader attention, it pays to note that the people in the study were scanning on average the first 16 characters of the titles.
So, it's interesting to truncate your title to 16 characters and see how they hold up. If you put something that interests a reader in the first 16 characters, there's a pretty good chance the rest of your title will be read. Once someone has clicked through to your question it's almost assured your question will be read. The main job of the title on the questions page is to get the reader that far.
- formatting numbe
- turning the USB
- how to UPSERT in
- raise an existin
- best way to hand
- move an existing
- sum 3 columns in
- Best way to sear
- Constructing ima
- Inserting BLOBs
What OS am I run
- Linux USB: turni
- Oracle: how to U
- Python: What OS
- X11: raise an ex
- XML-RPC: best wa
- X11: move an exi
- SQL: sum 3 colum
- Oracle: best way
- HTML: Constructi
- Postgresql: Inse
- Python: What OS
A question title should be a one-sentence summary of the problem at hand, that sets the question apart from other questions. Nothing more, nothing less. The purpose of a title is to allow whoever sees it to know what the question is generally about, without having to read the question body as well, especially when browsing through question lists. Try to capture what it is that you have a problem with, to as large an extent as reasonable within one line. Don’t worry if being specific makes the title long-winded; being wordy is better than being vague, and and as long as you fit within the length limit, the title should be okay. However, the summary doesn’t have to be entirely exhaustive either: if there’s a detail that you can’t fit within the title, you can always put it in the question body. But don’t bury the lede and resist the temptation to write clickbait. Don’t make it necessary to write an extension like DeArrow.
Good title formats are:
- How do I ⟨accomplish X⟩?
- When I do ⟨X⟩, ⟨P happens⟩, but when I do ⟨Y⟩, ⟨Q happens⟩. Why?
- What is an ⟨X⟩?
- Is there a difference between ⟨X⟩ and ⟨Y⟩?
- Is it correct that ⟨claim P⟩?
where ⟨X⟩, ⟨Y⟩, ⟨P⟩ and ⟨Q⟩ should be noun and verb phrases referring to specific things, not vague determiners; i.e. no
How do I do this?.
Ideally, a question should be possible to answer based on the title alone (but even then, the question body should probably not be empty). Take a look at Quora: over there, each question is a one-liner, there are no long-form question bodies, and no one seems to mention that among their top complaints about that site.
More specific advice
(Many examples below are specific to Stack Overflow, but the general advice should apply generally.)
If you are asking about a piece of syntax featuring a punctuation character, it’s good practice to include both the character itself and its name written out in full. The latter is for the sake of search engines, which sometimes make searching for punctuation inconvenient (if at all possible); the former for the sake of non-native speakers who may fail to recognise the character by its name. As such, prefer ‘What does an exclamation mark (!) mean before a logical expression?’ to ‘
What does ! mean?’.
Avoid putting the following in titles:
- Salutations and greetings (
hello stackoverflow, hey everyone, hi guys, thanks in advance, etc.): greetings take space and don’t convey useful information. Q&A pairs are meant to be a low-context, impersonal public medium, focused on the problem at hand, not a communication between specific people. It is standard practice to remove greetings from the beginning of the post; they have no place in titles either.
- Begging and rushing: expressions meant to evoke sympathy are often annoying to other users and therefore counterproductive. They should not be placed either in the title or in the question body.
please help, please explain, etc.: Everyone asking a question is looking for help or explanations. You are not saying anything we don’t already know. Such phrases do not add anything to the question. I am a beginner, I am just a noob, I am a learner, etc.: Quite a few people here are beginners. If anywhere at all, mention it in the question body, preferably near the end; it may help answerers calibrate the depth of explanation. Remember that even if you are a newcomer, you will still be expected to know at least the fundamental vocabulary of the thing you are attempting to learn: the difference between loops, variables and functions, expressions and statements, declarations and definitions, etc. Otherwise, you will probably not be able to understand even the most elaborate answer. To put it more bluntly: even newbies are expected to be literate in the subject they are asking about. I am out of ideas: If you have actually exhausted every possibility known to you, you have done your due diligence. This is the very least of what you’re expected to do before asking. It goes without saying, so mentioning it is redundant. I need this ASAP: Your deadlines are your problem. The answerers are volunteers; they have no obligation to respond within any specific time frame. To demand so is very rude. Rushing answerers has no place anywhere in the question.
- Emoticons (
:(, 💩): Just don’t. Like begging, it will be perceived as emotionally manipulative and therefore poorly received.
- Vague and redundant phrasing: titles should be as specific and descriptive as reasonable. You are not writing a suspense novel; putting spoilers in the title is not only perfectly fine, it is expected and encouraged. However, don’t repeat things we already know by virtue of you asking a question here. Describe what you are attempting to do in the specific place you encountered a problem.
I don't know, I have a problem, an issue, trouble, strange behavior, understanding, can anyone help me: If you didn’t have a problem you don’t know a solution for, you wouldn’t be asking. Say what your problem is. question about: We already know you are asking a question. Don’t waste words on that: title space is scarce. Write in the title what is the question. easy problem, basic question: There are lots of easy questions asked here, and it will be just as apparent that your question is easy if you just say what it is. Don’t waste other people’s time by requiring them to click through to find out. a few questions, a couple problems: If your title says that you have multiple questions, then not only is your title bad, the question post itself probably needs to be closed as lacking focus. Unrelated questions should be asked separately. Multiple questions in one post are only acceptable when they all ask about related aspects of a single problem (more specific than ‘my program doesn’t work’). Even in that case, you should have the title describe that problem instead of wasting characters on stating that you have multiple questions. i have a doubt: Using ‘doubt’ as a noun meaning ‘question’ (as in, when asking about something) may be common in Indian English; it is however not only superfluous (see above), but also likely to be misunderstood as this meaning is not recognised in other dialects of English. Kindly do the needful and omit the word. weird, strange, broken, bizarre, confusion, how is this possible, etc.: If what you saw made sense to you, you wouldn’t be asking a question. Be specific: say what you expected to happen. doesn’t work, fails: Again, be specific. Explain the way it fails to do what you wanted. Alternatively, describe circumstances in which it did work, and how it differs from those in which it doesn’t. At the very least, explain precisely what failed. this word, this phrase, what does this mean?, what is the difference between these two?, etc.: Mention the specific word, phrase or symbol; or at least, mention where you encountered it. my code, my program, this program, this thing: As a rule of thumb, if your title contains a demonstrative or possessive pronoun (‘this’, ‘these’, ‘my’), it’s probably not detailed enough. Try to describe briefly what your code is attempting to do, in the specific fragment where you encounter the problem. This is not always easy to squeeze into one sentence, but at least try to do so anyway. If the snippet you are asking about is very short (fewer than 20 characters), you can even include it in the title directly. (That said, ‘How can I ⟨accomplish something⟩ in my code?’ is a pretty acceptable title.) an error, this error: Don’t just say ‘error’; describe the kind of the error or the error code. Explain also the circumstances in which you got this error. The detailed error message should at the very least appear in the question body. my other question: Don’t assume the reader is familiar with any other question of yours. Link to the other question in the body, if it is relevant. Preferably, however, make each question you ask stand on its own.
- Spurious Capitalization (
What Is The Difference Between…): if it’s not a proper noun (and has no other orthographic reason to be capitalised), do not capitalise it. You may confuse readers into thinking that the title uses a proper noun where it doesn’t. Writing a title in all-caps is right out: it’s just as rude as anywhere else on the Internet.
- Pseudo-tags (
[C++], (Windows), React |, [SOLVED], etc.): don’t put the technology you happen to be using, or the specific subject area where your question belongs, as a disjointed blob in the title. Tags already exist for the purpose of categorising questions; use them instead. Don’t mark a question as resolved in the title either; instead, mark an answer as accepted with the green check mark. If you came upon a solution on your own, you can write your own answer and accept that.
- Keyword dumps (
Windows path Python): A question title should be a complete grammatical sentence with a subject and a predicate (or at least a nominal sentence/gerund phrase). Don’t merely list what technologies, methodologies or techniques you’re using: describe what you are attempting to do with them. Again, to merely categorise the question, use tags. As a rule of thumb, if it doesn’t mention any action and doesn’t ask what something is, it’s probably a bad title.
- Error dumps (
TypeError: undefined is not a function): a specific error may appear in many different circumstances that have little to do with each other. The title should describe those circumstances, not merely the error message itself.
- Your ultimate overarching goal (
I am writing a webapp, TypeError in my Discord bot): a good question will be useful in many different circumstances, not just the original asker’s: someone else from you can run into the exact same problem while building something entirely different from you. The title should describe the single problem you are having, not the application of whatever you’re building. Those contextual circumstances belong in the question body only, if anywhere. Often they are entirely redundant; try to omit them. (If the particular technique you are trying to apply seems unorthodox, ill-advised and/or ill-motivated, you may be asked why you chose it; but this information doesn’t belong in the title either way.)
- Jokes. Say “you must be fun at parties” all you want, but yes, I really mean it. As far as I have seen, attempts at humorous or whimsical titles almost always come at the expense of clarity, which is paramount here. Another answer’s “Mr. Struct” question is probably the poster child here.
My jar of awful question titles
I have collected a list of questions with especially bad titles below. Many of them are now deleted, and therefore invisible to most users; can you tell what they were asking? Now imagine all questions looked like that. Would you be compelled to answer them? If you wanted to return to one of them, would you know what to look for?
- Hey, I am beginner programmer, and got stuck on this error in my project
- How is this possible in python?
- I don't know what is the problem of my code :(
- Would someone please explain this part of the code?
- What argument should i give?
- Python 3 Exercise: What's the difference between these two?
- I would like to ask for help in C# if any one can help me. Thanks
- I am learning c# and got an error while run the code
- How can I resolve this issueed.?
- Welcome everyone Is there anyone who has had a problem like this? It really overwhelmed me with it. How can Ito solve this problem?
- confirm way pls help its very simple for u guys but i dont know how
- How do I do v14 or v13?
- Hi I am new to python programming. I have written the following code but I keep getting this error. Can anyone help me at all please?
- Can you please tell me
- Hello guys, can anyone please find a error in my code
- program language C++ help if you like
- Cygwin and Grub again! Almost there
- What will be the python recursive for this?
- Python related question i guess this question makes me go nuts
- Trying to run a code but encountring an error. Help on this would be much appreciated
- I'm beginner in python so i have a problem , i can't solve this code
- The code is correct but the logic is incorrect. how
- New to Pine Script, Can anybody please?
- I don't understand why my code doesn't work
- Is this a bug or a functionality?
- Lua - OOP problems
- How can it be undefined?
- How can I "combine" these two?
- Python Challenge. What am I doing wrong?
- Can't understand what I'm doing wrong
- I am not getting an expected output from my code:(
- What does it store
- I really need you help. it is just simple computer-architecture question
- Issues with compiler
- ??? Adjectives?
- im unable to figure out why this music bot wont work
- OOP MULTIPROCESSING
- Can anyone suggest how to resolve this error
- Is this efficient?
- Do you know what this means?
- When is it ok to be !ok() with C++20 chrono dates?
- Very basic questions about bond investing
- c alignment of pointers
- i didn’t find that in Google
- Captcha woes xxx
- Is floating point math broken?
Keep in mind, though: just because a title is not quite as awful as the above, doesn’t mean it’s actually good.
Use full grammatically correct questions
Write every title as a full complete grammatically correct question sentence, and finish it with question mark
It makes the questions clearer, and more attractive.
Otherwise, we are writing in semi defined "title-language" that no one really speaks.
Repeat key tags in the title because:
it appears in more places, e.g. linked questions
a key tag may fall to second place any time behind an useless generic tag. Here are a few examples:
- How to test strings for lexicographic less than or equal in Bash?
stringtag has more hits than the
- How to create a video from images with FFmpeg?
imagetag has more hits than the
- How to test strings for lexicographic less than or equal in Bash?
How towhenever it applies, don't use:
How do I: yes, since you are asking, we know it is you :-)
What is the best way to: people don't usually not want the best way to
Sample good title that follows all above rules:
How to print an integer as hexadecimal in C?
Spelling, grammar and punctuation are important! Remember, this is the first part of your question others will see - you want to make a good impression. If you're not comfortable writing in English, ask a friend to proof-read it for you.
Bad: C# Math Confusion
Good: Why does using float instead of int give me different results when all of my inputs are integers?
Bad: [php] session doubt
Good: How can I redirect users to different pages based on session data in PHP?
Bad: android if else problems
Good: Why does str == "value" evaluate to false when str is set to "value"?
This style is further supported yet again by "Title" section of the new ask question wizard from as of 2019-04 https://stackoverflow.com/questions/ask?guided=true
Imagine you’re asking a question to another developer.
Say “Is there an R function for finding the index of an element in a vector?”
Don’t say “Please help with R”
Say “How to fix ‘Headers already sent’ error in PHP”
Don’t say “PHP error: Why isn’t this working?”
It seems that SO devs agree with me at least then ;-)