How to include image as Markdown in Visual Studio Code?

If you are here because the images would not render in vscode preview, here's my solution:

<img src="./2/to/img.jpg" alt="Getting started" />

Markdown accepts HTML syntax, so this just works also.


Question is old, however, I found a very nice plugin within visual studio code Paste Image

As the plugin suggests you can paste the image onto markdown file by pressing ctrl(cmd) + Alt +V.

Or

Open command palate pressing ctrl(cmd) + shift + p and select paste image. In the background the plugin creates a image file with date/time and puts reference on the markdown.


If the image is in the same directory as the Markdown file, you can use either:

![Getting Started](./img.jpg)
![Getting Started](img.jpg)

For a workspace layout like:

docs/
    images/
        img.jpg
    README.md

In README.md, this would be either:

![Getting Started](./images/img.jpg)
![Getting Started](images/img.jpg)