Base64 Encoder / Decoder

Encode and decode text, images and files to and from Base64 strings and data URIs.

Encode and Decode Base64 Strings, Images and Files

Base64 represents binary data using only 64 printable ASCII characters, which lets you carry arbitrary bytes through channels built for text — JSON payloads, HTML attributes, CSS stylesheets, email bodies and HTTP headers. The cost is size: Base64 output is roughly 33% larger than the original binary.

This tool handles both directions and both kinds of input. Encode Unicode text safely (including emoji and non-Latin scripts, which naive implementations mangle), or drop in an image to produce a ready-to-paste data: URI. Decoding works the same way in reverse, reconstructing the original file for download.

Key features

  • Text and file modes — encode a string, or encode any file into a full data URI with the correct MIME type.
  • Unicode safe — encodes via UTF-8 bytes, so emoji, Arabic, Chinese and Devanagari all round-trip correctly.
  • Live image preview — decoded image data URIs are previewed immediately so you can confirm the payload.
  • URL-safe variant — optionally produce the base64url alphabet used in JWTs and query strings.
100% client-side — no data leaves your machine

This tool runs entirely inside your browser using native Web APIs. Your files and text are never uploaded to a server, never logged and never shared with third parties.

How to use: Base64 Encoder / Decoder

  1. Choose encode or decode
    Use the mode switch at the top of the tool to set the direction of conversion.
  2. Provide your input
    Type or paste text into the editor, or switch to file mode and drop in an image or document.
  3. Read the result
    The output updates as you type. File encodes produce a complete data URI you can paste directly into HTML or CSS.
  4. Copy or download
    Copy the string to your clipboard, or — when decoding a file — download the reconstructed binary.

Technical specifications

Processing locationEntirely in your browser — no server round trip
Data uploadedNone. Files and text never leave your device
PriceFree — no account, no trial, no usage cap
CategoryDeveloper
Works offlineYes, once the page has loaded
Browser supportChrome 90+, Edge 90+, Firefox 90+, Safari 15+
Interface languagesEnglish, 中文, हिन्दी, Español, العربية

Frequently asked questions

Is Base64 a form of encryption?

No, and this matters. Base64 is an encoding, not a cipher — anyone can decode it instantly with no key. Never use it to protect passwords, tokens or personal data; use real encryption for that.

When should I inline an image as a data URI?

Data URIs remove an HTTP request, which helps for very small assets like icons under about 2 KB. Beyond that the 33% size penalty and the loss of separate caching usually outweigh the saved request.

Why does my Base64 string break with accented or non-Latin characters?

The classic JavaScript btoa() function only accepts Latin-1 characters and throws on anything else. This tool encodes the text to UTF-8 bytes first, which is why emoji and every script round-trip correctly here.

What is base64url and when do I need it?

It is a variant that replaces the + and / characters with - and _ and drops the trailing = padding, so the result is safe inside URLs and filenames. JSON Web Tokens use it for exactly this reason.

Related tools

Back to all tools