String Utilities 工具已更新 2 天前

Markdown Remove Images Keep Alt

Markdown Remove Images Keep Alt replaces every inline Markdown image with the alt text in its square brackets, dropping the URL and title. It accepts double-quoted, single-quoted and parenthesised titles, skips images inside fenced code blocks, and turns linked badges into plain text links. The conversion runs in your browser and downloads as markdown-without-images.md.

永久免费 易于使用 立竿见影的效果 私密且安全

使用 Markdown Remove Images Keep Alt

输入行
0
找到的图片
0
跳过了代码块
0
工作原理
将 转换![Logo](image.png)为 Logo。位于 或``` ~~~围栏代码块内的图像语法将得以保留。

输入 Markdown

粘贴包含图片的 Markdown 代码
支持类似 ![Alt](url "Title"). 的图片标题。

干净的输出

Markdown 中图片被替代文本替换

阅读内容

了解该工具的工作原理以及何时使用它。

Replace Markdown images with their alt text

Markdown Remove Images Keep Alt finds every inline Markdown image and swaps it for the description in its square brackets. ![Team photo at the 2025 offsite](photos/team.jpg "Offsite") becomes simply Team photo at the 2025 offsite. The image address and any title are dropped; the words that describe the picture stay where the picture was. On screen the tool is titled Markdown Remove Images.

Keeping the alt text rather than deleting the image outright matters. Well-written alt text often carries information the surrounding sentences rely on, for example "Chart showing sign-ups doubling in March". Throwing it away would leave holes in the meaning; keeping it turns a visual reference into readable prose.

When a text-only version is what you need

  • Plain-text channels. Email newsletters sent as text, SMS, chat tools and ticket systems cannot show Markdown images and display the raw syntax instead.
  • Content without hosted assets. When you move articles to a new platform before the images are migrated, broken image icons look worse than a short description.
  • Accessibility review. Reading a document with images replaced by their alt text is a fast way to see what a screen reader user hears. Empty or vague descriptions stand out immediately.
  • Language model and search input. Image URLs are long and meaningless to a text model. Alt text is short and descriptive.
  • Word counts and print layouts. Removing image syntax gives cleaner text for counting, printing or pasting into a word processor.

Which image forms are recognised

The conversion pattern in the tool covers the common inline image forms:

MarkdownResult
![Logo](logo.png)Logo
![Logo](logo.png "Company logo")Logo (double-quoted title)
![Logo](logo.png 'Company logo')Logo (single-quoted title)
![Logo](logo.png (Company logo))Logo (parenthesised title)
![Diagram](<images/my diagram.png>)Diagram (angle-bracket address with spaces)
![](spacer.gif)nothing; empty alt text leaves an empty string
![ Padded alt ](x.png)Padded alt (spaces trimmed)

Several images on one line are all converted. Ordinary links, written without the leading exclamation mark, are not touched.

Not converted

  • Reference-style images such as ![Logo][logo] with a separate definition line.
  • HTML images written as <img src="..." alt="...">.
  • Images inside fenced code blocks. Anything between ``` or ~~~ fences is preserved, as the "How it works" note on the tool explains, so documentation that shows image syntax as an example stays correct.

Linked images and badges

README files often wrap an image in a link, for example a build badge: [![Build status](badge.svg)](https://ci.example.com). The tool replaces the inner image, so the line becomes [Build status](https://ci.example.com), an ordinary text link with the alt text as its label. That is usually exactly what you want: the badge becomes a readable link that still goes somewhere.

It all happens in your browser

The conversion is done with JavaScript on this page. Your Markdown is not uploaded and no server is involved, so unpublished articles and internal documents stay on your device.

Step-by-step

  1. Paste your Markdown into the Input Markdown editor, or click Paste. Click Load sample to try a ready-made example.
  2. Check the counters at the top: Input lines, Images found (outside code fences) and Code blocks skipped.
  3. Click Remove Images in the header, or Remove under the editor.
  4. Read the Clean Output editor. A toast confirms "Images replaced with alt text." or tells you no Markdown images were found.
  5. Click Copy, or Download to save markdown-without-images.md.
  6. Clear empties both editors.

Writing alt text that survives well

Because the output is only as good as your alt text, a quick pass over your images before converting pays off:

  • Describe the purpose, not the file. "Screenshot of the Settings page with the Export button highlighted" beats "screenshot1".
  • Fill in empty alt text where the image carries meaning. Empty alt text produces nothing in the output, which is right for decorative spacers but wrong for a chart.
  • Avoid "image of" and "picture of". In the converted text these phrases read awkwardly.
  • Keep it short. One clear sentence is easier to read inline than a paragraph; long explanations belong in the body text or a caption.
  • Check punctuation. An image placed mid-sentence becomes words mid-sentence. If the alt text ends with a full stop, you may get doubled punctuation.

Example: turning a product update into a text email

Suppose a release note reads:

We redesigned the dashboard. ![New dashboard with the usage chart on the left](img/dash.png "Dashboard") The usage chart now loads twice as fast.

After conversion it becomes:

We redesigned the dashboard. New dashboard with the usage chart on the left The usage chart now loads twice as fast.

The description reads as part of the paragraph, but it lacks a full stop. That is typical: alt text is written as a caption, not as a sentence. A quick edit, adding a full stop or turning it into "(Image: New dashboard with the usage chart on the left.)", makes the text email read naturally. Images placed on their own line, as most images in documentation are, need no such edit, since the alt text simply becomes a short line of its own.

The Images found counter is also useful here as a checklist. If it reports twelve images and your email will be read by people who cannot see any of them, those twelve alt texts are now the only description they get, so it is worth reading each one once.

What not to do

  • Do not expect the image URLs to be kept anywhere. If you need a list of them, copy them out first, or use Markdown Links to URLs, which turns images into their addresses instead.
  • Do not use it to clean HTML images. Run Markdown Remove HTML for tags, keeping in mind that it removes the alt text too.
  • Do not rely on it for reference-style images; convert those to inline images first.

Limitations

  • Inline images only; reference-style and HTML images are not changed.
  • The alt text is matched up to the first closing square bracket, so alt text that itself contains ] is not recognised.
  • An image whose syntax wraps across two lines is not matched, because the tool works line by line.
  • An unclosed code fence protects the rest of the document, so images after it are not converted.
  • No size limit is set in code; very large files depend on your browser.

Frequently Asked Questions

常见问题解答

针对用户在信任结果之前常提出的疑问,提供简短解答。

The alt text from inside the square brackets, with surrounding spaces trimmed. The URL and any title are removed.

They are removed and nothing is put in their place, because there is no description to keep.

No. Lines inside fenced blocks marked with ``` or ~~~ are preserved, so image syntax shown as an example stays intact. The Code blocks skipped counter shows how many fenced blocks were found.

The image inside the link is replaced by its alt text, so the badge becomes a normal text link that still points to the same address.

No. Only inline Markdown images in the ![alt](url) form are converted.

No. The replacement runs in JavaScript in your browser and nothing is sent to a server.

Download saves markdown-without-images.md.

评论 (0)

用于用户讨论、边界情况及后续建议。
发表评论
您的评论提交后将公开展示。
目前尚无评论。快来发表第一条评论吧!
请告诉我们!
报告此工具的问题

请描述您遇到的问题,以便我们进行调查并改进该工具。

什么最有帮助
请提供输入内容、预期结果、实际结果、浏览器/设备信息,如有帮助,请附上截图。
“截图”按钮会截取浏览器中的页面,并将生成的图片作为附件添加到此表单中。
整页截图
通过 newisty 在您的浏览器中捕获。
尚未截取屏幕截图。
工具 报告