How to move markdown image paths to a cdn
- Step 1Load the article — Paste the Markdown or upload a single
.md/.mdx/.markdown/.txtfile containing relative image paths. - Step 2Get your CDN base URL — Copy the public base from your provider, e.g.
https://res.cloudinary.com/acct/image/upload/, a BunnyCDN pull-zone host, or an S3/CloudFront domain. - Step 3Prefix or remap — For a flat mirror, leave Find empty and paste the CDN base into Replace. For a restructure, set Find to the old folder and Replace to the new path.
- Step 4Use regex for sub-path capture — Tick Treat Find as regex if you need to keep part of the original path: Find
^img/(.+), Replacehttps://cdn.io/v1/$1. - Step 5Run and verify hosts — Click Run Image Paths and scan the output — every relative image should now carry the CDN host; external URLs should be unchanged.
- Step 6Upload assets and deploy — Copy the actual image files to the CDN (this tool edits text only), then download the rewritten Markdown and publish it.
Settings by CDN scenario
How to fill the three controls for the most common CDN moves.
| Scenario | Find | Replace | Regex |
|---|---|---|---|
| Flat mirror (CDN keeps folders) | empty | https://cdn.example.com/ | off |
| Rename a top folder | assets/ | media/ | off |
| Add a version segment after capture | ^img/(.+) | https://cdn.io/v2/$1 | on |
Strip a leading ./ | ./ | https://cdn.io/ | off |
Provider base-URL shapes (illustrative)
Typical public base patterns. Paste your account's exact base into Replace; the tool doesn't generate transformations or signatures.
| Provider | Typical base in Replace | Notes |
|---|---|---|
| Cloudinary | https://res.cloudinary.com/<cloud>/image/upload/ | Transformations (w_800/) can be baked into the base |
| BunnyCDN | https://<zone>.b-cdn.net/ | Pull-zone host points at your storage origin |
| Amazon S3 / CloudFront | https://<dist>.cloudfront.net/ | Use the distribution domain, not the raw bucket |
| Cloudflare R2 (public) | https://<bucket>.r2.dev/ | Or a custom domain mapped to the bucket |
Plan limits (markdown family)
Per-run size and character limits by tier.
| Plan | Max file size | Max characters | Files per run |
|---|---|---|---|
| Free | 1 MB | 500,000 | 1 |
| Pro | 10 MB | 5,000,000 | 10 |
| Pro-media | 50 MB | 20,000,000 | 50 |
| Developer | 500 MB | unlimited | unlimited |
Cookbook
CDN migration recipes. Replace the example hosts with your own account's base URL — the tool inserts the text exactly as typed.
Flat move to Cloudinary
CDN mirrors your folder layout, so an empty Find with the Cloudinary base prefixes everything.
Find: (empty) Replace: https://res.cloudinary.com/acme/image/upload/ Regex: off Before:  After: 
Move to BunnyCDN and drop the leading ./
Find the ./ prefix and replace it with the pull-zone host so relative paths become absolute.
Find: ./ Replace: https://acme.b-cdn.net/ Regex: off Before:  After: 
S3/CloudFront with a captured sub-path
Regex keeps the path after img/ and inserts it behind the distribution domain.
Find: ^img/(.+)$ Replace: https://d1234.cloudfront.net/$1 Regex: on Before:  After: 
Re-running on a half-migrated file is safe
Images already on the CDN are absolute, so they're skipped — only the remaining relative ones get prefixed.
Find: (empty) Replace: https://cdn.acme.net/ Regex: off Mixed input:  -> unchanged (already absolute)  -> https://cdn.acme.net/img/b.png
Reference-definition images move too
Reference-style image definitions are rewritten alongside inline ones.
Find: (empty) Replace: https://cdn.acme.net/ Regex: off Before: ![Figure 1][fig1] [fig1]: assets/fig1.png After: ![Figure 1][fig1] [fig1]: https://cdn.acme.net/assets/fig1.png
Edge cases and what actually happens
Image already on the CDN
PreservedAbsolute http(s):// and protocol-relative // URLs are skipped, so re-running after a partial migration only touches the relative paths that still need moving.
data: inline image
PreservedBase64 data: images carry their bytes inline and aren't on any host; the tool leaves them exactly as-is.
Cloudinary transformation in the base
SupportedYou can bake a transformation segment into Replace, e.g. .../image/upload/f_auto,q_auto/, and it's prepended verbatim. The tool doesn't validate or generate transformation strings.
Signed CDN URLs
Not generatedThis is a text rewriter; it can't compute signatures or expiring tokens. For signed delivery, generate URLs in your CDN tooling — this tool only handles static base prefixes and substring swaps.
Path with spaces
Not matchedAn un-encoded space ends the inline match early, so  won't be rewritten. Encode it as my%20pics/a.png first.
Regex hits only the first occurrence
By designRegex mode has no global flag — only the first match per path changes. For a repeated literal fragment, use literal mode (regex off) which replaces every occurrence.
Wrong base accidentally doubled
AvoidableIf you prefix twice you get https://cdn/https://cdn/..., but only on paths that were still relative — absolute ones are skipped. Reset and re-run from the original if you double-prefixed.
File over the character limit
RejectedFree caps at 500,000 characters / 1 MB. Larger articles need a higher tier or a split via the splitter before rewriting.
Multiple files at once
Single onlyOne document per run. Merge first or rewrite each file individually.
Frequently asked questions
Will this upload my images to the CDN?
No. It only rewrites the URL text inside the Markdown. Upload the actual image files to your CDN through your provider's dashboard or CLI, then deploy the rewritten document.
How do I prefix every image with my CDN host?
Leave Find empty and paste your CDN base (e.g. https://cdn.example.com/) into Replace. Every relative image and reference-definition path is prefixed in one pass.
Does it work with Cloudinary transformations?
Yes, as plain text. Put the full base including any transformation segment into Replace, e.g. https://res.cloudinary.com/acct/image/upload/f_auto,q_auto/. The tool doesn't generate or validate transformations — it inserts exactly what you type.
Can it generate signed or expiring CDN URLs?
No. It's a static text rewriter with no access to your CDN's signing keys. Use your provider's SDK for signed URLs; use this tool for the static base-prefix part of the migration.
What about images that are already on the CDN?
They're skipped. Any path starting with http://, https://, //, or data: is left untouched, which makes re-running on a partly-migrated file safe.
My CDN reorganised the folders — can I still migrate?
Yes. Use find/replace to swap the old folder for the new one, or tick Treat Find as regex and capture the sub-path with $1, e.g. Find ^img/(.+) → Replace https://cdn.io/v2/$1.
Does it touch reference-style image definitions?
Yes. [id]: path definition lines are rewritten alongside inline  images, so reference-style images move to the CDN too.
Will external third-party images be changed?
No — they're already absolute URLs, so they're skipped. Only your own relative paths are migrated.
How big a document can I migrate at once?
Free handles 1 MB / 500,000 characters. Pro is 10 MB / 5,000,000 characters, Pro-media 50 MB / 20,000,000, Developer 500 MB with no character cap.
How do I confirm the new URLs resolve?
After uploading your assets, run the rewritten file through the link validator to check the references, or preview the page on staging.
Can I migrate several files in a batch?
This tool is one-file-per-run. To do many at once, combine them with the merger, rewrite the result, then re-split if needed.
Is the migration reversible?
Keep your original. To revert, run find/replace with the CDN base as Find and an empty or relative Replace — though it's simplest to re-apply from the source document.
Privacy first
All Markdown processing runs locally in your browser using JavaScript. No file is ever uploaded to JAD Apps servers — only metadata counters are saved for signed-in dashboard stats.