Base64 Encoder / Decoder

Encode text or files as base64 or hex — decode base64 to text, hex bytes or a file.

Frequently asked questions

What is base64 used for?
It encodes binary data as ASCII text, so data can travel through channels that only handle text — email attachments, JSON payloads, data URLs and Authorization headers.
Which base64 variants are supported?
Standard (+ and / with = padding), URL-safe (- and _, no padding), Raw (standard alphabet without padding) and MIME (wrapped every 76 characters, as email uses). Pick a variant when encoding; decoding detects all of them automatically.
Does it handle Unicode and emoji?
Yes. Text is encoded as UTF-8 first, so emoji and non-Latin scripts work correctly in every variant.
Can it convert files?
Yes. Switch Input to File to encode any file as base64 (or a ready-to-use data URL) or as hex, or choose Output as File when decoding base64 to download the original bytes. Everything happens in your browser.
What about hex?
Hex works both ways. Encoding turns text or files into hex bytes, and decoding base64 can output the raw bytes as hex. Hex input tolerates spaces, newlines and 0x prefixes; hex output can be uppercase and space-separated.
Why is base64 longer than the original data?
Base64 uses 64 printable characters, so every 3 bytes of input become 4 characters — roughly 33% overhead, plus padding. That is the price of making arbitrary binary data safe to paste into text.

About this tool

Base64 turns binary bytes into plain ASCII so the data can travel through text-only channels such as JSON, HTML, email and data URLs. Hex is a simpler representation of the same bytes, two hexadecimal digits per byte. This tool converts in both directions, works with text or whole files, and supports the standard, URL-safe, raw and MIME variants.

How to use it

  1. Choose Encode or Decode, then select Base64 or Hex as the data format.
  2. Paste text or choose a file when encoding; paste base64 or hex bytes when decoding.
  3. Adjust the variant, output style, casing or byte spacing to match the target system.
  4. Copy the result, or download binary output as a file.

← All tools