Skip to content
hateitall

Base64 Encoder

Turn text or a whole file into Base64 for an API, a config value or a data URL, with every result decoded back to prove it is right.

Processed locallyIn: Text, Any fileOut: Base64, Base64url, Data URL

Loading tool…

How to use base64 encoder

  1. Type or paste text, or drop any file onto the box.

  2. Turn on URL-safe if the value goes into a URL, a filename or a JWT.

  3. Switch on Data URL to get a ready-made data: link with the file's type.

  4. Copy the result or download it as a .txt file.

What this tool does

  • Encodes text as UTF-8 first, so accents, Chinese, Arabic and emoji survive the trip.
  • Encodes files up to 100 MB: images, PDFs, fonts, anything.
  • Base64url output with or without padding, and optional 76-character line wrapping for email (MIME).
  • Switch to decoding with one click and feed the result straight back in.

How the result is verified

Every result is decoded again in the browser and compared byte for byte with your input before the green check appears. For text, the decoded bytes are also read back as UTF-8 and compared with what you typed.

Frequently asked questions

Why does my emoji give a different result from btoa()?

The browser's btoa() only accepts characters up to code 255 and throws on emoji. This tool encodes the text as UTF-8 bytes first, which is what servers, Python's base64 module and Node's Buffer do, so the results match those.

When should I use URL-safe Base64?

Use it whenever the value goes into a URL, a cookie, a filename or a JWT. It swaps + and / for - and _, which have no special meaning in URLs, and usually drops the = padding.

Is my data uploaded to a server?

No. Everything you drop, paste or type is processed by code running in this browser tab. You can check it yourself: open your browser's developer tools, watch the Network panel, and use the tool. No request carries your data.

Base64 or data URLs back to text, images or downloadable files

Base64 · Base64url · Data URL→ TextLight on device

Encode an image as a Base64 data URI for HTML or CSS

PNG · JPEG · WebP +→ Data URILight on device

Percent-encode text for query strings, full URLs or form data

Text · URL→ Percent-encoded textLight on device

Text to hex bytes and hex back to text, in five output styles

Text · Hex→ HexLight on device

RFC 4648, Base32hex and Crockford Base32 in both directions

Text · Hex bytes · Base32→ Base32Light on device