Markdown · <code>![alt](image.png)</code>

Images

An image is a link with a leading ! and the alt text in square brackets.

Key facts

Syntax<code>![alt](image.png)</code>
Title<code>![alt](image.png "title")</code>
Reference<code>![alt][id]</code>
Alt textRequired for accessibility
SizeNot controllable in core Markdown
StandardCommonMark §6.4

The same grammar as links

The exclamation mark turns the link into an image. The square brackets hold the alternative text, and the parentheses hold the source. Titles and reference definitions work exactly as they do for links, which means an image reference and a link reference can share an id.

Core Markdown has no width or height syntax. Renderers that support sizing use raw HTML or an extension. Without either, the image renders at its intrinsic size, which can break a layout.

Alt text is not a caption

Alt text describes the image for people who cannot see it and for search engines that cannot interpret it. It should convey the purpose, not repeat the surrounding sentence. Decorative images can use empty alt text, but Markdown has no explicit decorative flag; raw HTML or a renderer extension is needed.

A caption is visible text below the image and is separate from alt text. If the image is the only content of a link, the alt text becomes the link's accessible name.

Frequently asked questions

How do I resize an image in Markdown?

Core Markdown cannot. Use an HTML img tag with width or height, or a renderer-specific extension.

Can alt text contain formatting?

It is plain text. Emphasis markers inside alt text are not rendered; they are read literally.

New tools, straight to your inbox

One short email when we add tools worth using. No spam, unsubscribe anytime.