1. Home
  2. Developer & Security
  3. Base64 Encoder & Decoder

Base64 Encoder & Decoder

Convert any text to Base64 and back with full Unicode support, and turn images and files into Data URIs to embed directly in web pages and emails.

100% freeRuns in your browserNo sign-up
Output

What is Base64?

Base64 represents binary data (images, files) or text using only letters, digits and two symbols (+ and /), so it can travel through systems that only handle text — email, JSON and URLs. It's everywhere in web development: inlining small images in HTML and CSS, authentication headers and JWT tokens.

Note: Base64 is encoding, not encryption. Anyone can decode it, so never use it to hide secrets. For real protection use the encryption tool.

Features

  • Full UTF-8 support: encodes Arabic, accented characters and emoji correctly, unlike plain btoa which fails on non-Latin text.
  • URL-safe output: swaps + and / for - and _ and drops padding, for URLs and filenames.
  • Files and images: get a ready Data URI plus an <img> tag or CSS rule.
  • Binary decoding: if the decoded result isn't text, it downloads as a file.

When should you inline images as Base64?

Inlining helps for icons and very small images (under 5–10 KB) because it saves HTTP requests. But it adds about 33% to the size and inlined images can't be cached separately, so avoid it for large images. Compressing the image first with Compress Image greatly reduces the output.

Example uses

  • Sending an image inside a JSON API response.
  • Embedding a small logo in an HTML email template.
  • Decoding the middle part of a JWT to read its payload.
  • Building a Basic Authentication header from user:password.

How Base64 works

Base64 turns every 3 bytes of data (24 bits) into 4 characters from a set of 64 safe characters: upper- and lowercase Latin letters, digits, and + and /. If the data length isn't a multiple of 3, = padding is added at the end. That's why encoded data is about 33% larger than the original.

Base64 is not encryption!

This is the key point: anyone can decode Base64 in a second — it's a format change, not protection. Never use it to hide passwords or secrets. For real protection use File & Text Encryption with AES-256, and to verify file integrity use the Hash Generator.

Base64 in URLs

+ and / have special meaning in URLs, so the “Base64URL” variant replaces them with - and _ and drops padding — it's what JWT tokens use, for example.

Frequently Asked Questions

Is Base64 encryption?

No. It's a reversible encoding that needs no key and provides no protection.

Why does the size grow?

Every 3 bytes become 4 characters, increasing size by about 33%.

How do I decode a JWT?

Copy the middle segment between the dots, paste it and click “Decode” — URL-safe Base64 is handled automatically.

Does it support Unicode?

Yes. It uses UTF-8, so every language and emoji works.

Are my files uploaded?

No. Conversion happens in your browser.

Last updated: