64
64Encode
100% Client-Side • Zero Server Uploads • 8 Specialized Encoders

Encode to Base64 Instantly

Type or paste any UTF-8 text, JSON, or select a local file to convert into standard Base64 or URL-safe Base64url right in your browser.

Switch to Decode
Plain Text Input (UTF-8) 0 B
Base64 Output 0 chars

Specialized Base64 Encoders

Dedicated tools for images, PDFs, binary files, hex bytes, Data URIs, and Basic Auth.

Need to Decode? Visit 64Decode.com
UTF-8 & Batch

Text to Base64 (UTF-8) Encoder

Encode plain UTF-8 text, emojis, JSON, or multi-line batches into standard or 76-char MIME-wrapped Base64.

Text & Data Open Tool
Data URI & CSS

Image to Base64 & CSS/HTML Generator

Drag and drop PNG, JPG, WEBP, GIF, or SVG images to generate raw Base64, Data URIs, <img> tags, and CSS backgrounds.

Media & Files Open Tool
PDF & Embed

PDF to Base64 & Embed Generator

Encode PDF documents into Base64 strings, data:application/pdf Data URIs, and ready-to-paste HTML <iframe> embed snippets.

Media & Files Open Tool
Any File Type

File to Base64 Binary Encoder

Encode any binary file (ZIP, audio, font, DOCX, executable) into raw Base64 or Data URI directly in browser memory.

Media & Files Open Tool
Hex Bytes

Hexadecimal to Base64 Converter

Convert hexadecimal byte strings (continuous, space-separated, colon-separated, or 0x-prefixed) into Base64 or Base64url.

Developer & Security Open Tool
RFC 4648 §5

URL-Safe Base64url Encoder

Encode text into RFC 4648 §5 URL-safe Base64url (- and _ instead of + and /) with optional trailing = padding removal.

Developer & Security Open Tool
RFC 2397

Data URI Generator (HTML / CSS / SVG / MIME)

Build valid data:<mime>;base64,... URIs from raw code (SVG, HTML, CSS, JS) or uploaded files with live preview.

Developer & Security Open Tool
HTTP Header

HTTP Basic Auth Base64 Header Generator

Generate Authorization: Basic <base64> headers from username and password plus ready-to-use curl and fetch() snippets.

Developer & Security Open Tool
Quick Notes

Encoding Text and Files to Base64 Inside Your Browser

Base64 takes raw bytes and turns them into 64 plain ASCII characters (A-Z, a-z, 0-9, +, /) so binary data or special characters can travel safely inside JSON, YAML, HTML, or email headers. Everything on 64Encode runs in your own browser tab—nothing is uploaded to a server.

Why window.btoa() crashes on emojis and non-English text

If you open your browser console and run btoa("Hello 🌿"), JavaScript throws InvalidCharacterError. That happens because btoa() only accepts single-byte Latin-1 characters.

Here, your text goes through TextEncoder first to get raw UTF-8 bytes, and those bytes are encoded to Base64 (SGVsbG8g8J+Mvw==). So emojis, Hindi, Arabic, and accented letters encode cleanly every time.

Which toolbar options should you tick?

  • URL-Safe (- / _) — tick this if the Base64 string is going into a URL, query parameter, or filename.
  • No Padding (=) — tick this for JWTs or URLs so you do not get %3D at the end.
  • Wrap 76 chars — only needed for old MIME email bodies or PEM-style text blocks.
  • Line-by-Line — encodes each line separately instead of one big block.

Need to turn Base64 back into readable text or files? Jump over to 64Decode.

FAQ

Quick Answers

Does 64Encode send my text or files to a server?

No. Everything runs locally in your browser using TextEncoder and FileReader. You can check the Network tab in DevTools to see zero uploads.

Why does Base64 make my text or file about 33% bigger?

Base64 packs every 3 bytes (24 bits) into 4 ASCII characters (6 bits each). That 4-for-3 expansion is built into the Base64 standard.

When should I use URL-Safe (- / _) instead of standard Base64?

Use URL-Safe whenever the output will sit in a URL path, query string, or filename. Standard + and / characters have special meanings in URLs and file paths.

Can I encode a local file right from the homepage?

Yes. Click Load File in the toolbar to encode any local file directly into the output box.

How do I decode a Base64 string back to text or an image?

Click Switch to Decode in the top bar or visit 64Decode.com.