How to Embed a Screenshot in Markdown (GitHub Issues, READMEs and Stack Overflow)
Updated November 5, 2026 · 8 min read
Markdown is everywhere developers write: GitHub and GitLab issues, pull requests, READMEs, wikis, Stack Overflow, Discord, Notion and documentation sites. Adding a screenshot takes one line, as long as you use the right kind of link. Here's the syntax, how to resize images, and how each platform handles them.
The syntax

!tells Markdown this is an image, not a normal link.- The text in
[ ]is the alt text: what screen readers say, and what appears if the image fails to load. Describe what the image shows. - The URL in
( )must point to the image file itself, a direct link such as one ending in.png.
Add an optional title (shown on hover) in quotes:
.
Resizing: use HTML
Standard Markdown can't set an image size, but GitHub, GitLab and most renderers accept an HTML
<img> tag:
<img src="https://sshot.online/f/AbC2xyz.png" alt="Login button overlaps the footer" width="600">
Set only the width so the height scales automatically. To show two screenshots side by side, place
two <img> tags on the same line with smaller widths.
GitHub issues and pull requests
- Take the screenshot and copy it.
- Click in the comment box and press Ctrl + V (Cmd + V), or drag the file in.
- GitHub uploads it and inserts the Markdown for you. Edit the alt text it generates.
Using an external link instead is handy when the screenshot already exists as a link, when you want to reuse it across issues, or when you're writing in a tool that doesn't upload images. Use the direct link in Markdown syntax.
Before and after screenshots work well in pull requests. A small table keeps them side by side:
| Before | After |
|--------|-------|
|  |  |
README files
- Images in the repository: commit them to a folder like
docs/and use a relative path:. Best for images that should be versioned with the code. - External links: keep the repository small and are quick to update. Use a direct link from a host you trust to keep it online.
- Keep README screenshots small and up to date. An outdated screenshot is worse than none.
Stack Overflow
- Use the image button in the editor (or Ctrl + G) to upload, or paste a direct link in Markdown syntax.
- Post code and errors as text, not images. People can't copy or search text in a picture, and questions with code screenshots are often closed or downvoted. Use screenshots only for visual problems: layout bugs, rendering issues, UI states.
- For long code or logs, include the important part in the question and link to the full version: how to share code snippets online.
Other places that use Markdown
- GitLab and Bitbucket: same syntax; both accept pasted images.
- Discord: doesn't render Markdown images, but shows a preview for image links.
- Notion, Obsidian and many docs tools: accept Markdown image syntax or a pasted direct link.
- Trello descriptions: support Markdown images.
Fixing broken images
| Symptom | Likely cause | Fix |
|---|---|---|
| Broken icon or alt text shown | The URL is a web page, not an image | Use the direct link (which one) |
| Works for you, not others | The image needs a login | Use a public link |
| Shows as plain text | Missing ! or a space between ] and ( | Write  with no space |
| Image is huge | Retina screenshot at full size | Use an HTML <img> with width |
Paste a screenshot and copy the direct link, ready for  in GitHub, READMEs and docs.
Frequently asked questions
What is the Markdown syntax for an image?
. The exclamation mark makes it an image; the text in square brackets is the alt text; the URL in brackets must point to the image file.
How do I resize an image in Markdown?
Standard Markdown has no size option. On GitHub and many other sites you can use HTML instead: <img src="url" alt="text" width="600">.
How do I add a screenshot to a GitHub issue?
Paste it with Ctrl+V or drag it into the comment box. GitHub uploads it and inserts the Markdown for you. You can also paste a direct image link in Markdown syntax.
Why is my Markdown image broken?
Usually the URL points to a web page instead of the image file, the image needs a login, or there is a typo such as a space in the URL. Use a direct link ending in .png or .jpg.
Should I post code as a screenshot on Stack Overflow?
No. Post code and error messages as text so people can search and copy them. Use screenshots only for visual problems such as layout or UI bugs.
Related articles
Direct Image Link vs Share Link: Which One Should You Use?
Every upload gives you a share link and a direct image link. See exactly when to use each, with examples for chats, email, Markdown, Google Docs, forums and AI tools.
Read More →How to Use SSHOT for Bug Reports: Developer's Guide
Learn how to report bugs with screenshots for faster fixes, with a step-by-step process, best practices, and a ready-to-use bug report template.
Read More →How to Share Code Snippets Online Without Breaking the Formatting
Share code so indentation survives: why chat apps mangle code, how to share a clean link with line numbers and a raw view, how to choose between a snippet link, a gist and a screenshot, and what to remove first.
Read More →