# How do I add an image to a Markdown file?

> Write ![alt text](image-url) where you want the image to appear. The alt text describes the picture for screen readers and broken links, and the URL can be a web address or a path to a local file like images/photo.png. For GitHub, drag the file into the comment box to get a hosted link, then paste it into the same syntax.

- **Canonical URL**: https://memecub.com/guides/how-to-add-image-markdown
- **Category**: How-tos (https://memecub.com/guides/c/howto)
- **Language**: en
- **Updated**: 2026-12-04

## Recommended Memes (Copy-Ready Markdown)

### Just Let Me Use Markdown Damn It Jira

- **When to send**: Send when a tool refuses to render your Markdown and you just want the image to show up.
- **Page**: https://memecub.com/meme/n3mefsw32b96-just-let-me-use-markdown-damn-it-jira
- **License**: Web-collected · Personal use

![Just Let Me Use Markdown Damn It Jira](https://gpic.code-nav.cn/memecub/public/n3mefsw32b96.png)

### Image life without Google &amp; Stack Overflow

- **When to send**: The moment you forget the bracket order and go back to searching for the syntax.
- **Page**: https://memecub.com/meme/bxtrtmmz7myl-image-life-without-google-amp-stack-overflow
- **License**: Web-collected · Personal use

![Image life without Google &amp; Stack Overflow](https://gpic.code-nav.cn/memecub/public/bxtrtmmz7myl.jpg)

### The Syntax Pedant's TED Talk

- **When to send**: For the reply that corrects your parentheses versus brackets in the image syntax.
- **Page**: https://memecub.com/meme/svvbpu9anm1t-the-syntax-pedant-s-ted-talk
- **License**: Web-collected · Personal use

![The Syntax Pedant's TED Talk](https://gpic.code-nav.cn/memecub/public/svvbpu9anm1t.jpg)

### Encouraging image

- **When to send**: A nudge of encouragement when a broken image link ruins your README.
- **Page**: https://memecub.com/meme/xvvjbw2f00t8-encouraging-image
- **License**: Web-collected · Personal use

![Encouraging image](https://gpic.code-nav.cn/memecub/public/xvvjbw2f00t8.jpg)

### When Syntax Ruins Your Romantic Gesture

- **When to send**: When a stray bracket turns your carefully written alt text into plain text.
- **Page**: https://memecub.com/meme/8ncgjxt9iuwk-when-syntax-ruins-your-romantic-gesture
- **License**: Web-collected · Personal use

![When Syntax Ruins Your Romantic Gesture](https://gpic.code-nav.cn/memecub/public/8ncgjxt9iuwk.jpg)

### Code example is left as an exercise to the reader

- **When to send**: For docs that say the image example is left as an exercise to the reader.
- **Page**: https://memecub.com/meme/i3tk53qmeanm-code-example-is-left-as-an-exercise-to-the-reader
- **License**: Web-collected · Personal use

![Code example is left as an exercise to the reader](https://gpic.code-nav.cn/memecub/public/i3tk53qmeanm.png)

## The basic syntax

An image in Markdown is an exclamation mark, square brackets for the alt text, and parentheses for the URL: ![alt text](image-url). The exclamation mark is what separates an image from a normal link.

Alt text is not decoration. It is read by screen readers and shown when the image fails to load, so write what the picture shows: ![screenshot of the settings page](settings.png).

The URL can be absolute (https://example.com/cat.png) or relative to the Markdown file (images/cat.png). Relative paths are what you want for local images in a repo.

## Local images, GitHub and VS Code

For a local image, keep the file next to your Markdown or in a subfolder and reference it by path: ![diagram](assets/diagram.png). The path is case-sensitive on GitHub and most servers.

On GitHub, open the issue or comment box and drag the image in, or paste it from the clipboard. GitHub uploads it and inserts a link you can copy into your Markdown file.

In VS Code, drag a file from the explorer into the editor and it inserts the image syntax for you. The Markdown preview (Ctrl+Shift+V) shows whether the path resolves.

## Size, captions and things Markdown does not do

Plain Markdown has no size syntax. To control width, use HTML: <img src="cat.png" alt="cat" width="300">. Many renderers also accept an attribute list after the image, but support varies.

There is no standard caption syntax either. The common workaround is an italic line under the image, or a figure element in HTML.

If you need a picture for a chat or a doc and nothing in your folder fits, memecub's AI meme maker can generate one from a description, and the AI meme placement tool can pick a fitting meme for each paragraph of an article.

## FAQ

### Can you put emojis in Markdown?

Yes. Paste the emoji directly, or use a shortcode like :smile: on platforms such as GitHub that support it.

### What is ``` in Markdown?

Three backticks open and close a fenced code block. Text inside is shown as code, not formatted.

### How can I convert a photo to Markdown?

You do not convert the photo itself. Upload or host the image, then reference its URL with ![alt text](image-url).

### What does ### do in Markdown?

It makes a level-three heading. More hashes mean a deeper heading level, up to six.

### Why is my Markdown image not showing?

Usually the path is wrong or the file name case does not match. Check the relative path from the Markdown file and confirm the image was committed.

## Related Guides

- [How do I add a caption to an image in Markdown?](https://memecub.com/guides/add-caption-to-image-markdown.md) ([HTML](https://memecub.com/guides/add-caption-to-image-markdown))
- [How do I add a meme to a Markdown file in VS Code?](https://memecub.com/guides/add-meme-markdown-vscode.md) ([HTML](https://memecub.com/guides/add-meme-markdown-vscode))
- [How do I use an AI meme generator API in my app?](https://memecub.com/guides/use-ai-meme-generator-api-in-app.md) ([HTML](https://memecub.com/guides/use-ai-meme-generator-api-in-app))
- [How do I build my own meme skill for Claude Code?](https://memecub.com/guides/build-your-own-claude-code-meme-skill.md) ([HTML](https://memecub.com/guides/build-your-own-claude-code-meme-skill))
- [How do I call a free meme API in Python?](https://memecub.com/guides/free-meme-api-python-example.md) ([HTML](https://memecub.com/guides/free-meme-api-python-example))
- [How do I call an open source emoji meme API in Python?](https://memecub.com/guides/call-open-source-emoji-meme-api-python.md) ([HTML](https://memecub.com/guides/call-open-source-emoji-meme-api-python))

---
Provided by [memecub](https://memecub.com) · Full index: [https://memecub.com/llms.txt](https://memecub.com/llms.txt) · Remote MCP: `https://memecub.com/mcp`