Base64 encoder & decoder

Encode text or files to Base64 and decode them back.

FreeRuns in your browserNo signupUpdated 2026-10-29

Text is treated as UTF-8, so accented letters, โ‚น and emoji round-trip correctly. Nothing is uploaded.

Status

Encoded

Input

49 B

Raw bytes

Output

68 B

+39% vs input

base64.txt
SGVsbG8gZnJvbSBNU0ggVGVjaG5vbG9naWVzIOKAkyDigrkxLDAwMCBhbmQg8J+agA==

About this tool

How it works and how to read the result.

Need this done for you?

Web app & SaaS development

SaaS products and web apps, from first version to scale.

See the service

What it does

The Base64 decoder and encoder converts text or a file to Base64 and back, entirely in your browser. Text is handled as UTF-8, so accented letters, the rupee sign and emoji survive the round trip. Choose a file and you get a complete data URL with the right MIME type, ready to paste into an img tag or a CSS url(). Decoding accepts standard and URL-safe alphabets, with or without padding, and strips a data URL prefix if one is present. If the decoded bytes are not text, you can download them as a file instead.

How to use it

  1. Pick Encode or Decode. The example input switches to match.
  2. Type or paste the text, or choose a file to encode as a data URL.
  3. For tokens and URLs, tick the URL-safe option so plus and slash become hyphen and underscore.
  4. Copy the output. When decoding something that is not text, use the download button to save the raw bytes.

How to read the result

The size cards show input and output bytes and the percentage change. Encoding the example sentence, 42 characters with an en dash, a rupee sign and a rocket emoji, gives 49 input bytes, because those three characters take 3 or 4 bytes each in UTF-8. The output is a 68-character Base64 string, 39 percent larger: 4 characters for every 3 bytes, plus padding.

When decoding, "Decoded" with readable text means the input was UTF-8. "Binary data" means the bytes did not form valid UTF-8, which is normal for an encoded image, PDF or certificate; download the file and open it with the right program. "Invalid input" means a character outside the Base64 alphabet, often a stray space, line break or a truncated copy.

For data URLs, compare the output size with the original. A 4 KB SVG icon becomes about 5.4 KB inline, which can be worth it to save a request. A 300 KB photo becomes 400 KB of text inside your HTML, which is not.

Related: the JWT decoder uses URL-safe Base64 for each token part. We handle encoding details like these in web app development.

Questions

Frequently asked.

Is Base64 encryption?

No. Base64 is an encoding, not encryption. Anyone can decode it in an instant, as this page shows. It exists so that binary data can travel through systems that only accept text, such as email bodies, JSON fields and data URLs. Never use it to hide secrets.

Why is the encoded text longer than the original?

Base64 represents every 3 bytes as 4 characters, so output is about 33 percent larger, plus up to two padding equals signs. A 30 KB image becomes a 40 KB string. That is why inlining large files as data URLs makes pages slower rather than faster.

What is the URL-safe variant?

Standard Base64 uses plus and slash, which have special meaning in URLs. The URL-safe alphabet from RFC 4648 swaps them for hyphen and underscore and usually drops the padding. JSON Web Tokens use this variant. The decoder here accepts both forms.

Your next move

Like what you see? Tell us about it.

A process that takes too long, a website that undersells you, or an idea ready to take shape. Tell us where you are and we will suggest a useful next step.

India ยท Working with clients worldwide

We reply within a working day. No spam, ever.