The image syntax
An image is an exclamation mark, then square brackets for the alt text, then parentheses for the image URL. The exclamation mark is the only difference from a normal link. The alt text is what screen readers announce and what is shown if the image fails to load, so it is worth writing properly.
- 
- 
Writing good alt text
Alt text describes the image for people who cannot see it and for search engines. Write what the image conveys, not the file name — 'A Code 128 barcode encoding the value INV-2026-0417' is useful; 'barcode' or 'img1' is not. If the image is purely decorative, an empty alt (a pair of empty brackets) is acceptable, but most documentation images carry meaning.
Linking an image to a URL
To make an image clickable — common with a logo that links home, or a screenshot that opens the full-size version — wrap the image syntax inside link brackets. The outer brackets create the link and the inner image becomes its content.
- [](https://example.com/full.png)
Controlling image size in Markdown
Standard Markdown has no syntax for width or height. Images render at their natural size, capped by the page width. To control size you need raw HTML with an img tag and a width attribute, which most renderers pass through — but keep in mind that a fixed size hurts responsiveness on small screens.
- <img src="image.png" alt="alt text" width="300">
Hosting and relative paths
An image URL can be absolute (https://...) or relative. A relative path like ./images/diagram.png resolves against the location of the Markdown file, which is why images stored in a repository render on GitHub but may not load in a viewer that does not have the repository. Remote images load from their own host, which means that host can see the request — relevant for private documents.
Common mistakes
- Forgetting the leading exclamation mark, so the image renders as a link
- Leaving spaces in the path — use %20 or move the file
- Wrong case in the file name on a case-sensitive host
- Relative paths that work in a repository but not when the file is rendered elsewhere
- Missing alt text, which hurts accessibility and gives no fallback if the image fails