"copy this". vs "copy this."


When you include an in-line word or phrase in quotation marks that the reader is supposed to copy, do you include punctuation inside the quotation marks or not?


The temporary password is “password.”


The temporary password is “password”.

(In my day to day work I bypass this problem by using styles rather than quotation marks for copyable phrases like this, but sometimes quotation marks are all you have.)


When I’ve been constrained to using quotes for copyable phrases, I usually include a parenthetical tip that the quotes are not part of the phrase. This helps literalists like me who confuse quotation marks with what they need to copy. It also negates having to include punctuation within the quotes.

For example: The temporary password is “password” (without the quotes).


I always do “copy this”. Prescriptive grammarians would disagree, but I prefer it because it’s unambiguous.


Like @hazel, I personally never include punctuation inside the quotation marks because if it’s in the quotation marks, people will include the punctuation when they copy the text. When possible I try to put the word or phrase to be copied not in-line and break it out to a line by itself, so quotation marks are not needed. (I acknowledge @sharon’s original question specified in-line and quotation marks, so breaking out to a new line and leaving the quotation marks off may not be possible.)


Another possibility is to avoid the issue entirely by using character formatting instead of quotes. For example:

  • If the reader is pasting the text in a CLI, you might use a monospaced font.
  • If the reader is pasting the text in a GUI, you might use bold.

I agree with previous comments that punctuation shouldn’t be included inside the quotes.


My understanding is that using punctuation within the closing quotation mark is accepted usage. If you are writing a narrative, then it should be used. That said, it’s also awkward if you want the reader to “click here.” I agree with what has already been said and could probably be formatted differently. If it’s a link, then the quotation marks are unnecessary.


US typographic style puts punctuation inside the closing quotes in all cases (regardless of context.) UK style puts punctuation outside. With some caveats:

In the case of quoted strings in technical documentation, the rule has been to avoid quotes altogether (using styles instead) or to rephrase the sentence so that the string does not fall at the end (“use ‘password’ for your temporary password”). You can also just be abundantly specific: “Your temporary password is ‘password.’ Do not include the quotes or the period.”)

But this is one of those things where we could argue minutia for days and not find the “right” solution. As with a lot of tech writing: pick a style and use it consistently.


For those types of scenarios where I need to be very specific, I’d limit punctuation by using something like this:

Your password is: password


I like that, @njeremy: it solves the problem with only in-line ASCII elements.

When I have styles available I use styles (such as bold or mono-spaced type), but I was interested about the case where you can’t use styles.


The Jargon File covers this issue in Chapter 5 of the Introduction (beginning from the second paragraph). I don’t know that the Jargon File is that authoritative as a style guide, but it is influential among various communities of programmers. To me it makes sense to follow its style (punctuation outside of the quotation marks) if your audience consists of programmers, because that is most likely the style they would expect. If your audience consists of people who have a very basic familiarity with computers, I would still use that style for the sake of clarity, or use one of the workarounds mentioned above if you’re worried about annoying editors or readers who favor the traditional style. If you’re the editor, you can choose which style you prefer. You are only answerable to your readers for your choice of style, so choose the style that you think would be most suitable for them.