According to the GitHub documentation, the Markdown syntax for inserting an image is:

![GitHub Logo](/images/logo.png)
Format: ![Alt Text](url)

Following their example syntax, I can't seem to be able to make it work.

Even the GitHub logo example does not work.

What am I missing? Or is it a GitHub bug?

  • Change the URL to a full path complete with the HTTP and see where that takes you Aug 2 '12 at 12:25
  • @EightDaysofMalaise: That does the trick indeed... Could you please write this as an answer? I reported the documentation error to Github.
    – nic
    Aug 3 '12 at 1:49
  • I think their documentation changed. "Image", "picture" and "logo" are no longer mentioned on the page.
    – user72479
    Dec 30 '15 at 20:15

You may be missing the full path/location to the image you want to include in your Markdown file.

The example given is a relative path, where the image rests on the same server as the file. In the help, it would assume the image is actually located at:


But that is not a valid file or location.

In order to make sure you can render an image no matter where you're viewing it from, it's safer to include the full URL, which would include the domain name.

So your example would instead be using something similar to this:

![Bilby Stampede](http://example.com/images/logo.png)

In response to the answer above:

As of January 30th, 2013, GitHub now allow relative links.

Make sure that you append ?raw=true to the end of the URL, though. Here is an example:


Due to the way GitHub handles URL's, if you do not append ?raw=true to the source URL your browser will attempt to load the page which displays the image.

  • Are you sure that update also includes using as src? Jan 31 '13 at 21:48
  • 1
    Yes, it does. Though, you have to append "?raw=true" to the end of the URL. Here's an example: ![Image](../blob/master/public_html/img/nokia.png?raw=true) Feb 1 '13 at 6:29
  • Just updated the answer :). Feb 1 '13 at 6:32
  • 1
    This works for my Markdown file but I get an error with pandoc: pandoc: Error producing PDF from TeX source. ! LaTeX Error: Unknown graphics extension: .png?raw=true. See the LaTeX manual or LaTeX Companion for explanation. Type H <return> for immediate help. ... l.175 ...2014-04-08_Bergman2011_Fig2.png?raw=true}
    – djhocking
    Apr 8 '14 at 20:55

I like to test my Markdown locally before pushing somewhere viewable only through a URL. So I want a relative URL that I can use anywhere. GitHub now supports those.

Your images subdirectory, assuming it's in the same directory as your Markdown file, doesn't need a slash at the beginning — try:

markdown ![GitHub Logo](images/logo.png)

instead of

markdown ![GitHub Logo](/images/logo.png)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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