I'm making a site where items are tagged. Each tag has its own page. For instance:

dog animal pet english-bull-terrier

Why do sites like StackOverflow use hyphens instead of spaces in their tags?

Is it so that the user can type multiple tags using just the space bar? Or are there other benefits?

  • 1
    it's a question of do you separate the tags themselves, or individual words in multi-word tags? My guess is that since there are more individual-word tags than there are multiple-word tags, it makes more sense to allow spaces to separate tags.
    – DA01
    Dec 2, 2013 at 20:57

2 Answers 2


The advantage of hyphenating tags allows you to define when a tag starts or ends while if you went for the option of using spaces, there will be a lot of confusion about the start and end point of a tag.

For example, If I wanted to tag San Francisco and my next tag was niners, if I entered all of it together, the system my take the tag as "San Francisco Niners" while I was trying to define two tags.

Another challenge I see is consistency in maintaining spaces between tags or after tags. If I have a space after a tag (which is space separated), then there is redundancy since my tag "Bull Terrier " and "Bull Terrier" denote the same tag but the space after the tag has created a new tag.Similarly if I enter "Bull Terrier" I have two spaces between the words and here a new tag is created.

Lastly spaces between tags as separators due to the difficulty in maintaining consistency can play havoc with the database with regards to maintaining unique values and consistent mapping

I also recommend looking at some of the responses in this question What makes a good tag separator?. To quote the top answer

The - in the tags is technically convenient for a couple reasons:

  1. The - can be used in the URL neatly and reliably shared by email (email programs are notorious for screwing up unformatted URLs). Technically a space would be url-encoded as a + or a %20. However, Google will also interpret dashes as spaces and that's what matters.

  2. In StackExchange you can actually search for tags in the search box and when they have a - in them, the search engine is able to infer that you're looking for tags.

  • Your first example makes some what sense, but what happens if tags were designed just like they are on here (top right under "tagged"). There wont be any confusion. As for everything else, that seems more technical than design related, and both of which can be resolved to avoid such problematic blocks. Is there research on this matter? I'm curious about this too.
    – UXerUIer
    Dec 2, 2013 at 21:24
  • Again, this seems odd. Let's take wordpress for instance. Tags don't have to have spaces, visually speaking, but when linked, the spaces are replaced with dashes to make them url friendly and arguably SEO friendly. I can see potentially allowing tags to be searched on a site, but shouldn't a search engine still search for something even with spaces? I mean imagine having to input, in google, dashes everytime you type out a sentence. That wouldn't do.
    – UXerUIer
    Dec 2, 2013 at 21:32
  • Yes, technically speaking the spaces would be replaced with dashes because we can't have spaces in urls, but, visually speaking, what does that mean? I honestly think there is no difference, depending on style./
    – UXerUIer
    Dec 2, 2013 at 21:33
  • "Lastly spaces between tags as separators due to the difficulty in maintaining consistency can play havoc with the database with regards to maintaining unique values and consistent mapping" <- I fail to understand the rationale behind this. The database doesn't care if my tag's table contains a tag named "Bull Terrier", it only cares that there's only one tag with that name. If you're allowing spaces in tag names and using spaces as your tag delimiter, then there's a problem. However, the problem is from improperly inferring the tags themselves, not because of the way they are stored.
    – cimmanon
    Dec 2, 2013 at 21:55
  • Agreed with that @cimmanon
    – UXerUIer
    Dec 3, 2013 at 15:45

Are we talking technically speaking or visually speaking?

Visually speaking, it would make no difference how tags are shown, as long as they are separated in a way where it is readable. Tell me, can you read this properly?


download bmml source – Wireframes created with Balsamiq Mockups

Now how about this?


download bmml source

Obviously the first example is easier to discern what tag is what because it comes back to the Gestalt principle: Items grouped together appear to be apart of one element.

The second example is harder to understand because you can't tell which one is which. Even if you do add dashes. It comes down to how you organize and group elements to make them more readable.

Technically speaking, that's a different story, and that's not what this place is for. But what I can say is design is how something works. If you figure the design, then you can figure how it works!

Not the answer you're looking for? Browse other questions tagged or ask your own question.