# How do I resize an image in Markdown?

> Standard Markdown has no way to set image size: ![alt](url) always renders at the image's natural size. To resize, either drop in an HTML tag like <img src="pic.png" alt="alt text" width="300">, or use a renderer-specific option such as an attribute list ({width=300}) in Pandoc, a size suffix in Obsidian, or a width parameter in GitHub's HTML output. If your platform strips HTML, resize the file itself before uploading.

- **Canonical URL**: https://memecub.com/guides/resize-image-in-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 it when a tool refuses plain Markdown and forces you into a rich-text editor.
- **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)

### Never set a container height....

- **When to send**: The exact feeling of an image squeezed into a fixed width or height box.
- **Page**: https://memecub.com/meme/uw7ajk9sgf7p-never-set-a-container-height
- **License**: Web-collected · Personal use

![Never set a container height....](https://gpic.code-nav.cn/memecub/public/uw7ajk9sgf7p.png)

### body {resize: horizontal}

- **When to send**: For the moment you try to fix layout with CSS instead of just resizing the image.
- **Page**: https://memecub.com/meme/qy4vfimrb5i5-body-resize-horizontal
- **License**: Web-collected · Personal use

![body {resize: horizontal}](https://gpic.code-nav.cn/memecub/public/qy4vfimrb5i5.jpg)

### I can hear this image

- **When to send**: When the image renders at full size and breaks the whole page.
- **Page**: https://memecub.com/meme/xnd8f9czwoyg-i-can-hear-this-image
- **License**: Web-collected · Personal use

![I can hear this image](https://gpic.code-nav.cn/memecub/public/xnd8f9czwoyg.jpg)

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

- **When to send**: For the search-tab spiral after your Markdown image syntax still does not work.
- **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)

### It honesty be like that; best part is when it displays the wrong number and you have to spend 3 hours figuring out why

- **When to send**: When the preview looks right but the published page shows something else.
- **Page**: https://memecub.com/meme/63cvoa0oq2vp-it-honesty-be-like-that-best-part-is-when-it-displays-the-wr
- **License**: Web-collected · Personal use

![It honesty be like that; best part is when it displays the wrong number and you have to spend 3 hours figuring out why](https://gpic.code-nav.cn/memecub/public/63cvoa0oq2vp.jpg)

## The three ways to set image size

HTML tag (works almost everywhere that allows inline HTML): <img src="cat.png" alt="A cat" width="300">. Add height="200" only if you want to force both dimensions; setting one keeps the aspect ratio.

Attribute list (Pandoc, some static site generators): ![alt text](cat.png){width=300px height=200px}.

Renderer-specific syntax: Obsidian uses ![[cat.png|300]], some wiki and CMS tools accept ![alt](cat.png =300x200). Check your platform's docs before relying on it.

## When resizing does not work

GitHub READMEs render HTML img tags, so width and height attributes work there; plain Markdown size syntax does not.

If HTML is stripped (many comment boxes, some chat apps), resize the image file first and upload the smaller version.

For a caption, put the image on its own line and add an italic line under it, or wrap it in <figure> and <figcaption> where HTML is allowed.

For a local file, use a relative path like ![alt](images/cat.png); in VS Code the preview resolves it from the Markdown file's folder.

## Picking the right image

A resized image still needs to fit the tone of the post. If you need a reaction image for a README, a blog post or a chat, memecub.com has a searchable meme library you can browse and download without signing up.

Most memes there are collected from the web: fine for personal chats, with copyright staying with the original creators. If the image will be used commercially, turn on the openly licensed filter.

If nothing in the library fits, the AI meme maker at memecub.com/generate takes a character, action and caption and returns an image in about ten seconds.

## FAQ

### How do I change the size of an image in Markdown?

Plain Markdown cannot do it. Use an HTML img tag with width or height, an attribute list if your renderer supports it, or resize the file before uploading.

### How do I set image width and height in Markdown?

In HTML: <img src="pic.png" width="300" height="200">. Setting only width keeps the aspect ratio, which usually looks better.

### How do I insert an image from a local file?

Use ![alt text](path/to/image.png) with a path relative to the Markdown file. In VS Code, the preview shows it directly.

### How do I add images to a GitHub README?

Upload the image to the repo or drag it into the issue or README editor, then reference it with Markdown or an HTML img tag. GitHub renders width and height attributes.

### How do I add a caption to a Markdown image?

Standard Markdown has no caption syntax. Put an italic line under the image, or use <figure> and <figcaption> where HTML is allowed.

## Related Guides

- [How do I add an image to a Markdown file?](https://memecub.com/guides/how-to-add-image-markdown.md) ([HTML](https://memecub.com/guides/how-to-add-image-markdown))
- [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 insert a meme in Markdown using an API?](https://memecub.com/guides/insert-meme-markdown-api.md) ([HTML](https://memecub.com/guides/insert-meme-markdown-api))
- [How do I resize a meme without losing quality?](https://memecub.com/guides/how-to-resize-a-meme-without-losing-quality.md) ([HTML](https://memecub.com/guides/how-to-resize-a-meme-without-losing-quality))
- [What is the Linux meme command?](https://memecub.com/guides/linux-meme-command.md) ([HTML](https://memecub.com/guides/linux-meme-command))

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