Image ⇄ Base64 — drag-drop PNG/JPG/WebP/SVG, get data URI for CSS / HTML / Markdown.
- Runs locally
- Category Image
- Best for Getting images to the right size, format, or weight before publishing.
What this tool does
A two-way image ⇄ Base64 converter that runs entirely in your browser. Drop a PNG, JPG, WebP, GIF, SVG, or ICO and instantly get the raw Base64, the full `data:image/...;base64,...` URI, plus one-click wrappers for CSS `background-image`, an HTML `<img>` tag, or Markdown `` — paste straight into your stylesheet, template, or README. Going the other way, paste a Base64 string or a data URI and the tool decodes it back to a preview with a Download button so you can recover the original file. Size, encoded length, and the typical +33% Base64 overhead are shown next to each result so you know when inlining is worth it. No uploads, no server round-trip, no quota: FileReader + Blob do the whole job locally, even for SVGs with embedded `<style>` tags and animated GIFs.
Tool details
- Input
- Files + Text + Structured content
- The page exposes text boxes, numeric controls, file pickers, or structured inputs depending on the tool.
- Output
- Live result + Copy + Download
- The result area focuses on usable output, with copy, download, or preview actions when supported.
- Privacy
- Browser-side processing
- The main tool logic does not call an external API, so inputs normally stay in the current tab.
- Save / share
- Shareable URL state
- Key settings are encoded in the URL so another person can reopen the same setup.
- Performance budget
- Initial JS <= 16 KB
- No WASM budget is declared, keeping the tool quick to open on mobile.
- Best fit
- Image · Developer
- Category and role tags drive related tools, internal links, and quick fit checks.
How to use
-
1. Input
Paste or drop your content into the tool panel.
-
2. Process
Click the button. All processing is local in your browser.
-
3. Copy / Download
Copy the result or download to disk in one click.
How Base64 Image Converter fits into your work
Use it while preparing images for websites, stores, social posts, forms, or handoff packages.
Image jobs
- Getting images to the right size, format, or weight before publishing.
- Checking privacy-sensitive EXIF and metadata before sharing a photo.
- Creating publish-ready variants without uploading private assets.
Image checks
- Resize to the real display size before compressing.
- Review transparency, animation, and color profile changes after conversion.
- Strip or review metadata when the image contains private context.
Good next steps
These links move the current task into a more complete workflow.
- 1 SVG Optimizer SVG optimizer — strip comments/metadata/empty attributes, round path decimals, collapse useless groups, minify in browser. No upload. Open
- 2 SVG to Data URI / CSS Background Inline any SVG as a data URI — URL-encoded (smaller) or base64 — with ready-to-paste CSS, HTML and bare-URI output, side-by-side size diff, 100% in-browser. Open
- 3 Base64 Encoder & Decoder Encode or decode Base64 — text, files, and Data URLs. Runs entirely in your browser. Open
Real-world use cases
Inline a 2 KB nav logo to kill a render-blocking request
Your header logo is a 2.1 KB PNG that fires a separate request before first paint. Drop it here, copy the CSS `background-image` snippet, and paste it into your stylesheet. The logo now ships inside the already-loaded CSS, saving one round-trip on every cold visit. The encoded size readout confirms it grew to ~2.8 KB, still under the 4 KB inline threshold.
Embed an icon into a single-file HTML email template
You are building a transactional email that renders in Outlook and Gmail with no external image hosting allowed. Encode your 24×24 status icon, grab the `<img src="data:image/png;base64,...">` tag, and drop it straight into the template. The image survives forwarding and offline reading because nothing is fetched, and the 33% overhead readout tells you the final byte cost up front.
Recover an original file from a Base64 string in a config
A teammate pasted a `data:image/webp;base64,...` blob into a JSON config and you need the actual file back. Paste the whole URI into the decode side, watch the preview render, and hit Download to get the exact original WebP bytes, byte-for-byte. No guessing the MIME type by hand: the tool reads it from the URI prefix.
Drop an SVG icon into a README with embedded styles intact
You want a small status badge in your GitHub README that keeps its gradient and embedded `<style>` block. Encode the SVG, copy the Markdown `` line, and paste it in. Because the SVG is treated as raw bytes, the gradients, filters, and `<defs>` all survive instead of getting flattened or stripped.
Common pitfalls
Inlining a 200 KB hero image to "save a request" — it bloats your HTML by ~267 KB and tanks LCP; host anything over a few KB and use a normal URL instead.
Pasting a raw Base64 string without its `data:image/png;base64,` prefix into an `<img src>` — the browser shows a broken image; always include the full data URI, which is the second output box, not the first.
Forcing SVG through Base64 when `data:image/svg+xml,...` (URL-encoded, no Base64) is often 20-30% smaller and just as portable for `background-image`; only Base64 the SVG when a tool refuses the plain form.
Privacy
Every image you drop or paste is read with `FileReader` and converted entirely inside your browser tab. Nothing is uploaded: open DevTools and the Network panel stays at zero requests during encode or decode. Your inputs are never written to the URL either, so a shared link carries no image data and no Base64 string. Once the page is cached, the whole tool works offline.
FAQ
Tool combos
Folks in your role tend to reach for these alongside this tool.
- 555 Timer Calculator Astable f = 1.44/((R1+2R2)C) + monostable t = 1.1RC — pick R1, R2, C in Ω/kΩ and µF/nF, read frequency, duty cycle and pulse width — browser-only
- Add Line Numbers Number every line of pasted text — set start, step and separator, zero-pad to align, skip blanks, or strip numbers back off — browser-only
- AES Text Encryptor Encrypt & decrypt text with a password — AES-256-GCM + PBKDF2 via WebCrypto — 100% in your browser, nothing uploaded
- Affine Cipher Encoder & Decoder Encrypt and decrypt the ax+b affine cipher with live modular-inverse check, browser-only