How to Format URLs in Text

What are these strange beasts?

Mignon Fogarty,
November 13, 2015
Episode #490

how to format urls in text

Today's topic is how to treat URLs when you have to use them in text.

Web addresses are strange beasts; they seem more like equations or long numbers than words. All the rules for how to handle uniform resource locators (or URLs) in documents are matters of style, but some styles make more sense than others.

URLs and Terminal Punctuation

URLs always have internal periods and often are scattered with other punctuation marks and symbols such as question marks, slashes, and percent signs. So what do you do when one shows up at the end of a sentence? Should you include the period or other terminal punctuation mark at the end of the sentence as you normally would? Leave off the period so the reader doesn't mistakenly include it in the address? Or do something funky such as put quotation marks around the Web address? As you're weighing your options, first consider whether you are writing for print or the Web.


If you're writing for print, Web addresses don't need special treatment. Put the period, question mark, or exclamation point at the end of the sentence just as you would if the sentence ended with a word or a number. Most people these days know that URLs don’t end with periods, so there’s not much risk people will mistake the period as part of the address if they’re manually typing it into an address bar. 

You may choose to highlight the URL in some way, such as making it bold or blue, but it isn't necessary, and APA style actually recommends removing special colors and underlining so the address looks the same as surrounding text.


When you're including a URL on a blog, in an e-mail program, or in some other online environment and the link will be active, years ago you used to have to worry that if your URL was at the end of a sentence, a period at the end would be included when the interface automatically generated an active link on the address and that the link would be wrong when people clicked on it, and my advice back then was to leave a space between the end of the URL and the period that ends your sentence. Systems have gotten better, so now it’s generally not necessary to leave a space, which is great because I always hated how that looked.

Still, you should make sure all your links work properly because not every system is perfect. Twitter, for example, knows not to include periods, question marks, or exclamation points in the active address if you type them right after a URL, but Apple’s Pages word processing software knows to exclude the period and exclamation point, but since addresses often contain question marks, sometimes it will still include the question mark in the live link (for example, if you type cnn.com? it won’t include it, but if you type http://cnn.com? it will include it).

My advice today is if you have a URL at the end of a sentence in a text document or a social media post, include the period, exclamation mark, or question mark like you normally would, with no space, but keep an extra eye out to make sure the terminal punctuation didn’t get included in the live link, especially if it’s a question mark.

Again, these are style choices, and remember that all the style manuals are especially picky about how citations are formatted and those styles can change over time, so when you’re including a Web address in a citation, be sure to check the specific style you’re supposed to be following. For example, current APA style is to not put a period after a URL in a citation. Their rationale is that the specific alphanumeric sequence is important because it is what points readers to the reference.

The Full Monty: Full URLs Versus Abbreviated URLs

Now, what about abbreviating the address? Some people prefer to write out the entire address including the http:// and www parts, whereas other people prefer to write the shortest address that will still work when you type it into a Web browser. 

Whether you should write out the full URL is also a matter of style. For example, the BuzzFeed Style Guide says not to use the http part, and only to use the www part when it is necessary for the link to work, which is almost never. The Modern Language Association style guide also recommends using the short URL in running text—simply Forbes.com instead of http://www.forbes.com, for example).

But even here there are style differences. BuzzFeed wants you to write forbes.com with a lowercase F, and MLA wants you to write Forbes.com with a capital F. As usual, my advice is to pick a style and be consistent.

Long URLs

The next problem you are likely to encounter is what to do with a long URL. You know what I mean: one of those dynamically generated URLs that seem to go on forever with equal signs and question marks and lots of numbers.

The most important thing is that if you have to break a URL across two lines, don't insert an extra hyphen at the line break. That will confuse people because it's common for URLs to contain hyphens. And if there is a hyphen in the address, don't make the line break right after it; because that will confuse people because they won't know whether you are improperly inserting a hyphen to mark the break or the hyphen is part of the address.

Instead, if you have to wrap the URL to a new line, find a natural break like a slash, number sign, or other symbol, or if you must, in the middle of a long string of letters or numbers. Use common sense: don't break a URL right after a period or readers might think the period marks the end of the sentence.

Click Here and Underlining

Next, when you're turning words into links on a Web page, it’s generally best to put the link on the words that describe what you are linking to. For example, link the words Grammar Girl’s article about how to format links instead of linking generic words such as click here. Sometime if writers have a lot of references, I’ve seen them put something like See here, here, and here, in parentheses, with each here linking to a different source, and I can see how it’s kind of efficient, but I still recommend using meaningful link text because it’s more search engine friendly and makes it easier for people with visual impairments to navigate your site (because they may be using software that only reads the link text to them.)

Finally, it's best to avoid underlining things for emphasis on websites because underlining is the style for an active link on the Web. I know it's possible to make links any style you want if you fiddle with the code, but underlining is the default style, so if you underline text, some people will think it's an active link, and they will be annoyed when they try to click on it and it doesn't work. And I believe one of your top goals should be to avoid annoying your readers. That just makes sense.


This is an update of an article that was originally published September 5, 2008.


Related Tips