# URLs: Why a backslash?

**URL:** <https://boards.straightdope.com/t/urls-why-a-backslash/603971>\
**Category:** Factual Questions\
**Created:** [November 24, 2011, 2:50pm UTC](https://boards.straightdope.com/t/urls-why-a-backslash/603971 "2011-11-24T14:50:00Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![njtt](https://avatars.discourse-cdn.com/v4/letter/n/ecd19e/32.png) [@njtt](https://boards.straightdope.com/u/njtt)\
**Post date:** [November 24, 2011, 5:50pm UTC](https://boards.straightdope.com/t/urls-why-a-backslash/603971/21 "2011-11-24T17:50:00Z")

</div>

> [@engineer\_comp\_geek](#):
>
> It’s not the browser, it’s the web server. The [http://boards.straightdope.com/](http://boards.straightdope.com/) part (aka the domain) gets you to a specific machine. Everything after that (the path) is interpreted by the web server on that machine…

Well, yes, but there are already three slashes in the bit that you quoted that gets you to the server. OK the last one is optional, but surely the browser has to interpret at least the first two. These days, it seems, if you leave them out or use backslashes there instead, Firefox inserts slashes or changes back- to forward slashes on your behalf. (It really does not like it if you leave out the colon, though!)

---

<div class="post-metadata">

**Author:** ![yabob](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/yabob/32/2821_2.png) [@yabob](https://boards.straightdope.com/u/yabob)\
**Post date:** [November 24, 2011, 6:06pm UTC](https://boards.straightdope.com/t/urls-why-a-backslash/603971/22 "2011-11-24T18:06:48Z")

</div>

> [@filmore](#):
>
> The / character is slash. The \ character is backslash. Dos/Windows is the one who does it backwards.
> 
> The use of \ by Dos/Windows is incredibly stupid. When writing programs, the \ character is used to indicate that the next character is special in some way. For example, I may put "  
> " in the code to indicate a newline. Or " " to indicate a tab. The problem when writing code in Windows is that I have to backslash the backslash when I program paths into my code. For example, I have to do this:
> 
> path = “c:  
> ew\ est”
> 
> I have to backslash the backslash. If I just had “c:  
> ew est”, the compiler would turn the  
> into a newline and the into a tab.

Fortunately, many APIs allow the forward slash to be used in paths for Windows based files. “c:/new/test” will work just fine for specifying a Windows file in java, for instance. I’ve worked in commercial environments where this point had to be made to some people, who kept trying to special case their code to provide or translate backslashes if running on Windows when it wasn’t necessary. At most, you need to worry about it at the point where file syntax is shown through to the user - the Windows user may expect to see filenames with backslashes, and to input them with backslashes. Even there, the API will often help you - the java File object has a “getCanonicalPath()” which provide the name with the backslashes, however you chose to specify it (it will also provide the leading directory syntax if you specified it as a relative path, which may or may not be what you want).

---

<div class="post-metadata">

**Author:** ![Colophon](https://avatars.discourse-cdn.com/v4/letter/c/f05b48/32.png) [@Colophon](https://boards.straightdope.com/u/Colophon)\
**Post date:** [November 24, 2011, 6:10pm UTC](https://boards.straightdope.com/t/urls-why-a-backslash/603971/23 "2011-11-24T18:10:39Z")

</div>

> [@Dewey\_Finn](#):
>
> If it helps, Tim Berners-Lee [regrets](http://news.bbc.co.uk/2/hi/technology/8306631.stm) including the slashes and says that he could have designed URLs so that they didn’t need them.

He seems to be talking about the “http://” part at the start, though, which nobody has actually typed since about 2003.

The slashes within URLs, as in [boards.straightdope.com](http://boards.straightdope.com)\*\*/ **sdmb** /\*\*newreply.php, are another matter.

---

<div class="post-metadata">

**Author:** ![OpalCat](https://avatars.discourse-cdn.com/v4/letter/o/8edcca/32.png) [@OpalCat](https://boards.straightdope.com/u/OpalCat)\
**Post date:** [November 24, 2011, 6:37pm UTC](https://boards.straightdope.com/t/urls-why-a-backslash/603971/24 "2011-11-24T18:37:10Z")

</div>

> [@njtt](#):
>
> URLs do **not** use a backslash. They use a regular forward [slash](http://en.wikipedia.org/wiki/Slash_%28punctuation%29). It is DOS paths that use a backslash.

Thank you. It drives me batty when people say “backslash” in URLs. IT’S NOT A BACKSLASH! QUIT SAYING THAT! I’ve heard people on TV read out URLs and say “backslash” and I want to reach into the TV and punch them.

---

<div class="post-metadata">

**Author:** ![pulykamell](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/pulykamell/32/3166_2.png) [@pulykamell](https://boards.straightdope.com/u/pulykamell)\
**Post date:** [November 24, 2011, 8:22pm UTC](https://boards.straightdope.com/t/urls-why-a-backslash/603971/25 "2011-11-24T20:22:51Z")

</div>

> [@njtt](#):
>
> URLs do **not** use a backslash. They use a regular forward [slash](http://en.wikipedia.org/wiki/Slash_%28punctuation%29).

Yeah, this is one of my peeves, when I hear broadcasters occasionally refer to the slash in a URL as a backslash. It’s a regular slash, people!

ETA: Evidently, I am blind or haven’t refreshed my browser in awhile. I see that **OpalCat** agrees.

---

<div class="post-metadata">

**Author:** ![urban1a](https://avatars.discourse-cdn.com/v4/letter/u/e47c2d/32.png) [@urban1a](https://boards.straightdope.com/u/urban1a)\
**Post date:** [November 25, 2011, 3:36am UTC](https://boards.straightdope.com/t/urls-why-a-backslash/603971/26 "2011-11-25T03:36:42Z")

</div>

> [@njtt](#):
>
> URLs do **not** use a backslash. They use a regular forward [slash](http://en.wikipedia.org/wiki/Slash_%28punctuation%29). It is DOS paths that use a backslash.
> 
> Why DOS does that, I have no idea. The slash is a regular punctuation mark, but the backslash seems to be pretty much entirely confined to computing uses.

Oh, but using the backward \ sets MS-DOS apart from UNIX (which uses the forward /) which is one way Bill Gates could distinguish his product from other existing ones.

Bob

---

<div class="post-metadata">

**Author:** ![panamajack](https://avatars.discourse-cdn.com/v4/letter/p/47e85d/32.png) [@panamajack](https://boards.straightdope.com/u/panamajack)\
**Post date:** [November 25, 2011, 4:48am UTC](https://boards.straightdope.com/t/urls-why-a-backslash/603971/27 "2011-11-25T04:48:44Z")

</div>

> [@urban1a](#):
>
> Oh, but using the backward \ sets MS-DOS apart from UNIX (which uses the forward /) which is one way Bill Gates could distinguish his product from other existing ones.
> 
> Bob

That is _maybe_ why it persisted, though I’m not sure why Microsoft would find it necessary to do so. But as mentioned above, it was more or less inherited from previous usage. CP/M used the backslash, and QDOS used it in imitation. Microsoft bought QDOS and turned it into MS-DOS, and at the time there was no compelling reason to change it.

---

<div class="post-metadata">

**Author:** ![Mr\_Downtown](https://avatars.discourse-cdn.com/v4/letter/m/8e8cbc/32.png) [@Mr\_Downtown](https://boards.straightdope.com/u/Mr_Downtown)\
**Post date:** [November 25, 2011, 5:39am UTC](https://boards.straightdope.com/t/urls-why-a-backslash/603971/28 "2011-11-25T05:39:56Z")

</div>

> [@OpalCat](#):
>
> IT’S NOT A BACKSLASH! QUIT SAYING THAT!

Don’t get me started on the ones who say _dash_ when they mean _hyphen._

---

<div class="post-metadata">

**Author:** ![Robot\_Arm](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/robot_arm/32/18280_2.png) [@Robot\_Arm](https://boards.straightdope.com/u/Robot_Arm)\
**Post date:** [November 25, 2011, 6:10am UTC](https://boards.straightdope.com/t/urls-why-a-backslash/603971/29 "2011-11-25T06:10:31Z")

</div>

> [@OpalCat](#):
>
> Thank you. It drives me batty when people say “backslash” in URLs. IT’S NOT A BACKSLASH! QUIT SAYING THAT! I’ve heard people on TV read out URLs and say “backslash” and I want to reach into the TV and punch them.

It drives me nuts when people read a URL and say “forward slash”. IT’S JUST A PLAIN SLASH, YOU DON’T NEED TO “FORWARD” IT. Mike Rowe used to do that at the end of _Dirty Jobs_ when he was asking people to go to the website and suggest new jobs for him. I hate him for that, and it has nothing to do with the fact that every woman I know lusts after him.

I also blame Bill Gates for popularizing the backslash enough that people feel compelled to differentiate the forward slash.

Here’s a solution, we could borrow from the INTERCAL manual and call them “slat” and “backslat”.

---

<div class="post-metadata">

**Author:** ![Derleth](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@Derleth](https://boards.straightdope.com/u/Derleth)\
**Post date:** [November 25, 2011, 6:17am UTC](https://boards.straightdope.com/t/urls-why-a-backslash/603971/30 "2011-11-25T06:17:47Z")

</div>

> [@panamajack](#):
>
> CP/M used the backslash

Where? What version of CP/M had directories?

---

<div class="post-metadata">

**Author:** ![Musicat](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/musicat/32/20189_2.png) [@Musicat](https://boards.straightdope.com/u/Musicat)\
**Post date:** [November 25, 2011, 1:12pm UTC](https://boards.straightdope.com/t/urls-why-a-backslash/603971/31 "2011-11-25T13:12:03Z")

</div>

> [@Robot\_Arm](#):
>
> It drives me nuts when people read a URL and say “forward slash”. IT’S JUST A PLAIN SLASH, YOU DON’T NEED TO “FORWARD” IT.

I work with a lot of non-technical, casual computer users, and it is imperative that I specify forward or backward slashes, or I will either get the wrong one used (where it matters) or the question will be asked. I like to head 'em off at the pass, nip it in the bud, so to speak.

---

<div class="post-metadata">

**Author:** ![jjimm](https://avatars.discourse-cdn.com/v4/letter/j/ba8739/32.png) [@jjimm](https://boards.straightdope.com/u/jjimm)\
**Post date:** [November 25, 2011, 1:15pm UTC](https://boards.straightdope.com/t/urls-why-a-backslash/603971/32 "2011-11-25T13:15:27Z")

</div>

> [@Robot\_Arm](#):
>
> It drives me nuts when people read a URL and say “forward slash”.

The BBC does this by default, all the time, and it is astonishingly annoying. But better than when they used to say “stroke” instead.

---

<div class="post-metadata">

**Author:** ![Ximenean](https://avatars.discourse-cdn.com/v4/letter/x/aca169/32.png) [@Ximenean](https://boards.straightdope.com/u/Ximenean)\
**Post date:** [November 25, 2011, 2:02pm UTC](https://boards.straightdope.com/t/urls-why-a-backslash/603971/33 "2011-11-25T14:02:54Z")

</div>

My contribution to URL Pronunciation That I Find Irrationally Irritating would be the way some people say “www dot, acme dot, co dot, uk”, instead of “www, dot acme, dot co, dot uk”, the way it should be. That is, in speech they group the dot with what precedes it, not what follows it. I mean, back around the millennium we had the dotcom bubble, right? Not the “dot, com” bubble.

---

<div class="post-metadata">

**Author:** ![robert\_columbia](https://avatars.discourse-cdn.com/v4/letter/r/e79b87/32.png) [@robert\_columbia](https://boards.straightdope.com/u/robert_columbia)\
**Post date:** [November 25, 2011, 2:48pm UTC](https://boards.straightdope.com/t/urls-why-a-backslash/603971/34 "2011-11-25T14:48:43Z")

</div>

There was a old joke back in the 1990’s:

I heard that OJ Simpson now has an email address:

slash slash backslash, slash slash backslash escape

---

<div class="post-metadata">

**Author:** ![Heracles](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/heracles/32/487_2.png) [@Heracles](https://boards.straightdope.com/u/Heracles)\
**Post date:** [November 25, 2011, 8:14pm UTC](https://boards.straightdope.com/t/urls-why-a-backslash/603971/35 "2011-11-25T20:14:13Z")

</div>

> [@panamajack](#):
>
> CP/M used the backslash, and QDOS used it in imitation. Microsoft bought QDOS and turned it into MS-DOS, and at the time there was no compelling reason to change it.

CP/M didn’t have hierarchical directories, as I recall. But it did have command switches that started with a normal slash (" dir /p "), and MS-DOS 1.0 followed suit (as **yabob** and **Small Clanger** have already stated).

So when the people at Microsoft wanted to add hierarchical file systems to MS-DOS 2.0 (to make hard drives more manageable) they chose the backslash to avoid parsing conflicts.

---

<div class="post-metadata">

**Author:** ![Musicat](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/musicat/32/20189_2.png) [@Musicat](https://boards.straightdope.com/u/Musicat)\
**Post date:** [November 25, 2011, 8:26pm UTC](https://boards.straightdope.com/t/urls-why-a-backslash/603971/36 "2011-11-25T20:26:02Z")

</div>

> [@Heracles](#):
>
> CP/M didn’t have hierarchical directories, as I recall.

Right, AFAIK. It had “user areas.” Stupid idea.

---

<div class="post-metadata">

**Author:** ![OpalCat](https://avatars.discourse-cdn.com/v4/letter/o/8edcca/32.png) [@OpalCat](https://boards.straightdope.com/u/OpalCat)\
**Post date:** [November 25, 2011, 9:01pm UTC](https://boards.straightdope.com/t/urls-why-a-backslash/603971/37 "2011-11-25T21:01:44Z")

</div>

I’m going to be twitching until the OP comes back and acknowledges that URLs don’t use a backslash.

---

<div class="post-metadata">

**Author:** ![Dewey\_Finn](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/dewey_finn/32/4222_2.png) [@Dewey\_Finn](https://boards.straightdope.com/u/Dewey_Finn)\
**Post date:** [November 25, 2011, 9:09pm UTC](https://boards.straightdope.com/t/urls-why-a-backslash/603971/38 "2011-11-25T21:09:22Z")

</div>

The OP is **Jinx**. You’re going to be twitching forever.

---

<div class="post-metadata">

**Author:** ![OpalCat](https://avatars.discourse-cdn.com/v4/letter/o/8edcca/32.png) [@OpalCat](https://boards.straightdope.com/u/OpalCat)\
**Post date:** [November 25, 2011, 9:17pm UTC](https://boards.straightdope.com/t/urls-why-a-backslash/603971/39 "2011-11-25T21:17:33Z")

</div>

AhhhahhhhhhhhH!!! _twitch twitch_

---

<div class="post-metadata">

**Author:** ![Derleth](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@Derleth](https://boards.straightdope.com/u/Derleth)\
**Post date:** [November 25, 2011, 10:42pm UTC](https://boards.straightdope.com/t/urls-why-a-backslash/603971/40 "2011-11-25T22:42:48Z")

</div>

> [@Heracles](#):
>
> CP/M didn’t have hierarchical directories, as I recall. But it did have command switches that started with a normal slash (" dir /p "), and MS-DOS 1.0 followed suit (as **yabob** and **Small Clanger** have already stated).
> 
> So when the people at Microsoft wanted to add hierarchical file systems to MS-DOS 2.0 (to make hard drives more manageable) they chose the backslash to avoid parsing conflicts.

And to finish the story, they (the MS-DOS 2.0 developers) added the kind of hierarchical file system they did due to their experience with Xenix, which was Microsoft’s fairly successful Unix clone for the IBM PC. That wasn’t all the Unix they added to MS-DOS, either; a number of system calls were ported as well, to the extent you can port a Unix system call to MS-DOS. Essentially, the design of MS-DOS 2.0 was “Add as much Unix as you can to this CP/M clone without making it too big to fit on the target system or breaking too much existing software.” Using backslash instead of slash as the path separator was firmly in the “not breaking too much existing software” side of that design constraint.

[Previous page](https://boards.straightdope.com/t/urls-why-a-backslash/603971.md?page=1)

[Next page](https://boards.straightdope.com/t/urls-why-a-backslash/603971.md?page=3)
