Skip to content
MixTool

Base64 encoder

Convert text or files to Base64 — including data URLs for images and URL-safe output for tokens.

  • Runs entirely in your browser
  • Free · no sign-up
  • Works on phone and desktop
Loading tool…

Text and files to Base64

Base64 turns binary data into plain ASCII characters so it can travel through systems built for text: JSON payloads, HTML and CSS, email attachments and HTTP headers. Type text and it's encoded as UTF-8 first, so accents, non-Latin scripts and emoji survive the round trip.

Switch to file mode to encode an image, PDF or any other file, with the option of a ready-to-use data URL (data:image/png;base64,…). URL-safe output replaces + and / with - and _ for tokens and query strings, and line wrapping at 76 characters matches the MIME email standard.

How to encode to Base64

  1. 1

    Choose text or file

    Type text or pick any file.

  2. 2

    Set the options

    URL-safe, line wrapping or data URL.

  3. 3

    Copy the result

    Or download it as a text file.

Key features

  • UTF-8 correct

    Emoji and every language encode properly.

  • Any file type

    Images, PDFs, fonts, audio and more.

  • Data URLs

    Embed small images straight into HTML or CSS.

  • URL-safe variant

    RFC 4648 base64url for tokens and URLs.

Common uses

  • Embedding images: Inline small icons in CSS to save a request.
  • API payloads: Send binary data inside JSON.
  • Basic auth headers: Encode user:password for an Authorization header.

Tips and good to know

  • Base64 makes data about 33% larger, so only inline small images.
  • Base64 is an encoding, not encryption — anyone can decode it with the Base64 Decoder.

Frequently asked questions

Is Base64 encryption?

No. It's a reversible encoding with no key. Never use it to hide passwords or secrets.

Why is the Base64 output bigger than the input?

Every 3 bytes become 4 characters, so encoded data is about a third larger.

What's URL-safe Base64?

A variant that uses - and _ instead of + and /, and usually drops the = padding, so the string can go in URLs and filenames without escaping. JWTs use it.

Are my files uploaded?

No. Files are read and encoded in your browser.