Skip to content

Convert files, images, or text into Base64 and Data URLs, or decode Base64 data URLs back to raw bytes locally.

Loading tool

About Base64 file converter

Convert a file or image into a Base64 string or data: URL, encode text with a MIME type of your choice, or decode Base64 or a data URL back into a downloadable file. When decoding, the file type is detected from its magic bytes (PNG, JPEG, GIF, WebP, AVIF, PDF, ZIP, MP4, WOFF2 and others), images are previewed, and the original and Base64 sizes are shown. Files are read locally in the browser and never uploaded.

Common uses

  • Inline a small icon or image in CSS or HTML as a data URL.
  • Recover a file from a Base64 blob found in an API response, JSON or a database.
  • Check what kind of file a Base64 string contains before saving it.
  • Embed an SVG or JSON snippet as a data: URL with the right MIME type.

FAQ

What is a data URL?
A data URL embeds file contents directly in a URL using the form data:[mime type];base64,[data], so a browser can display an image or load a resource without a separate request.
Should I inline images as Base64?
Only small ones. Base64 makes the data about 33% larger and inlined data cannot be cached separately from the page or stylesheet, so it suits small icons rather than photos.