Base64 Encode/Decode

Free Base64 encoder and decoder: encode or decode text with correct UTF-8, or turn files into Base64 and back. Runs in your browser; nothing is sent.

What do you want to convert?
Direction

Everything happens in your browser. Nothing is uploaded.

Encode and decode Base64 for text and files

Base64 turns any bytes into a string of 64 safe characters, so binary data can travel through systems built for text: email attachments, JSON payloads, data URIs in CSS, basic authentication headers and configuration files. This tool handles both directions for text, with correct UTF-8 for accented letters and emoji, and for whole files up to 25 MB, all without uploading anything.

How to use it

  1. Under What do you want to convert? choose Text or File.
  2. For text, pick a Direction: Encode or Decode, and type into Text to encode or Base64 to decode. Tick URL-safe Base64 when the result goes into a URL or a JWT-style token.
  3. Copy the output from Result. Use result as input swaps it back for a round-trip check.
  4. For files, drop one on Choose a file or drop it here to get its Base64, optionally with Include data URI prefix (data:…;base64,). To go the other way, paste into Paste Base64 or a data URI and press Download file.

Examples

  • Hello encodes to SGVsbG8=. The trailing = is padding that fills the last group of four characters.
  • Text with non-English letters is first turned into UTF-8 bytes, so ğüşıöç becomes xJ/DvMWfxLHDtsOn. Tools that skip this step produce garbage on decoding.
  • URL-safe mode writes - and _ instead of + and / and drops the padding, so the string can sit in a query parameter unchanged.

Size and limits

Base64 uses 4 characters for every 3 bytes, so encoded data is about a third larger than the original: a 300 KB image becomes roughly 400 KB of text. That is why embedding large images as data URIs usually slows a page down. Files are limited to 25 MB here to keep the browser responsive. When decoded data is not readable text, the tool says so and offers it as a file, recognising common types such as PNG, JPG, GIF, WebP, PDF, ZIP and MP3.

Working with JSON that carries Base64 fields? Tidy it with JSON Formatter. For values inside web addresses, use URL Encoder/Decoder instead.

Frequently asked questions

Is Base64 encryption?

No. It is an encoding that anyone can reverse instantly. Never use it to hide passwords or secrets.

Why do I get unreadable characters when decoding?

The data is probably a file, not text, or it was encoded from a different character set. Use the file option to download it.

What is a data URI?

A string like data:image/png;base64,... that contains a whole file. Browsers can display it directly in an img tag or CSS.

Are line breaks and spaces in Base64 a problem?

No. Whitespace is ignored when decoding, so wrapped Base64 from emails works.

Are my files uploaded?

No. Encoding and decoding happen in your browser.