OnlineFreeTools.org
  • Home
  • Image editing tools
    • Add Text Watermark to Photo — Local Browser Tool
    • Extract Colors from Image — Palette & Click Pick
    • Flip Image — Mirror Horizontally or Vertically
    • Add Border to Image — Color & Width Online
    • Image Compressor — Resize, Quality & Target Size Local
    • Crop & Resize Image — Local Aspect Presets
    • Photo EXIF Viewer & Remover — GPS, Camera & Local Strip
    • Image Format Converter — PNG JPEG WebP AVIF BMP GIF ICO SVG
    • Convert Image to Grayscale — Black & White Online
    • Merge Images — Combine Photos into One Collage
    • Image Optimizer — WebP, AVIF & MozJPEG Local
    • Overlay Images — Put a Logo on a Photo
    • Image to Base64 Converter — Encode & Decode Locally
    • Images to GIF — Make an Animated GIF Locally
    • Images to PDF — Combine Photos into One File
    • Images to PowerPoint — Photos to PPTX Slides
    • Images to Word — Build a DOCX from Photos
  • Design tools
    • Generate Brand Color Scale — 50–950 Palette & CSS Tokens
    • Brand Style Guide — Generate a Modular Draft You Can Edit
    • Smart Website Color Scheme — Semantic CSS Tokens
    • WCAG Contrast Checker — AA/AAA Ratio Online
  • Developer tools
    • Add WWW to DNS — A/CNAME, Apex Rules & Provider Guides
    • CSV ↔ JSON Converter — Types, Delimiters & Local
    • HTML Entity Encoder & Decoder — Escape, Unescape & Local
    • IndexNow — Bing URL Submit, Key Check & Status Codes
    • What Is My IP Address — See Your Public IP (IPv4 or IPv6)
    • JSON Schema Validator — Draft-07 Paths & Local
    • Markdown ↔ HTML Converter — Sanitize & Preview
    • Compare Two Texts Online — Text Diff Checker
    • Check HTTP Response Headers Online
    • YAML ↔ JSON Converter — Types, Multi-doc & Local
  • Calculators
    • BMI Calculator — How to Calculate Body Mass Index
    • Gradient Calculator — Multivariable ∇f (Partial Derivatives)
    • How to Calculate Marginal Revenue — MR Calculator (ΔTR / ΔQ)
    • Percentage Change Calculator — From Old Value to New
    • ROI Calculator — How to Calculate Return on Investment
    • Square Feet to Square Meters — Area Converter for Homes & Renovation
  • English
  • 中文
  • Español
  • العربية
  • Português
  • Bahasa Indonesia
  • Français
  • 日本語
  • Русский
  • Deutsch

Tools

Add Text Watermark to Photo — Local Browser ToolAdd WWW to DNS — A/CNAME, Apex Rules & Provider GuidesGenerate Brand Color Scale — 50–950 Palette & CSS TokensBrand Style Guide — Generate a Modular Draft You Can EditExtract Colors from Image — Palette & Click PickCSV ↔ JSON Converter — Types, Delimiters & LocalFlip Image — Mirror Horizontally or VerticallyBMI Calculator — How to Calculate Body Mass IndexGradient Calculator — Multivariable ∇f (Partial Derivatives)How to Calculate Marginal Revenue — MR Calculator (ΔTR / ΔQ)Percentage Change Calculator — From Old Value to NewROI Calculator — How to Calculate Return on InvestmentHTML Entity Encoder & Decoder — Escape, Unescape & LocalAdd Border to Image — Color & Width OnlineImage Compressor — Resize, Quality & Target Size LocalCrop & Resize Image — Local Aspect PresetsPhoto EXIF Viewer & Remover — GPS, Camera & Local StripImage Format Converter — PNG JPEG WebP AVIF BMP GIF ICO SVGConvert Image to Grayscale — Black & White OnlineMerge Images — Combine Photos into One CollageImage Optimizer — WebP, AVIF & MozJPEG LocalOverlay Images — Put a Logo on a PhotoImage to Base64 Converter — Encode & Decode LocallyImages to GIF — Make an Animated GIF LocallyImages to PDF — Combine Photos into One FileImages to PowerPoint — Photos to PPTX SlidesImages to Word — Build a DOCX from PhotosIndexNow — Bing URL Submit, Key Check & Status CodesWhat Is My IP Address — See Your Public IP (IPv4 or IPv6)JSON Schema Validator — Draft-07 Paths & LocalMarkdown ↔ HTML Converter — Sanitize & PreviewSmart Website Color Scheme — Semantic CSS TokensSquare Feet to Square Meters — Area Converter for Homes & RenovationCompare Two Texts Online — Text Diff CheckerWCAG Contrast Checker — AA/AAA Ratio OnlineCheck HTTP Response Headers OnlineYAML ↔ JSON Converter — Types, Multi-doc & Local

Image to Base64 Converter — Encode & Decode Locally

Convert images to Base64/data URLs and back in your browser—no upload. Steps: encode a file to copy a data URL, or paste Base64 to preview and download. Example: sample PNG → data:image/png;base64,… ready to paste into HTML — files stay on your device.

How it works

Use Encode to read a file as a data URL, or Decode to paste Base64 and download an image.

Rules

Encode uses readAsDataURL. Decode accepts data:image… or raw Base64 (default MIME image/png).

  • Optional strip of the data: prefix for raw Base64.
  • Invalid strings show an error.
  • Large strings may use more memory.
  • Nothing is uploaded.

Example

Sample encodes a small PNG and shows the data URL in the output box.

Good fits

  • Embed small icons in HTML/CSS.
  • Debug email or markdown image payloads.
  • Recover a preview from a Base64 dump.

Frequently asked questions

Uploaded?

No.

Data URL vs raw?

Data URLs include a MIME prefix; raw is only the Base64 body.

Huge files?

Possible but memory-heavy—prefer compress first.

Which MIME on decode?

Taken from the data URL, or image/png for raw.

Animated GIF?

Encoded as a file blob; animation is not edited here.

Related tools

  • Image Format Converter — PNG JPEG WebP AVIF BMP GIF ICO SVG
  • Image Compressor — Resize, Quality & Target Size Local

Share this tool

Share on social networks, copy the page link, or use your device share sheet.

XFacebookLinkedInRedditWhatsAppTelegram

https://onlinefreetools.org/tools/image-to-base64

Questions or feedback

Something unclear, broken, or missing? Draft a message below — we read every note about these tools.

Email: dailyonetools@outlook.com

References

  • MDN — FileReader.readAsDataURL()
  • MDN — Data URLs
OnlineFreeTools.org · Learning project · Iterating
About·Dev Logs·Privacy·Terms·Contact