Base64 encode and decode

Convert text to Base64 and Base64 back to text, right in your browser.

This Base64 tool converts plain text to Base64 and decodes Base64 back to text. Paste your text and press Encode to Base64, or paste an encoded string and press Decode from Base64. Everything runs in your browser, so even long or sensitive strings never leave your machine.

Try:
0Words
0Characters
0No spaces
0Sentences
0Paragraphs
0Lines
0Pages
0Reading
0Speaking

Runs entirely in your browser. Your text is never uploaded — open DevTools, Network tab, and you will see zero requests while you use this tool.

How to use it

  1. Paste your text or your Base64 string into the box.
  2. Press Encode to Base64, or Decode from Base64.
  3. The result replaces the text; press Copy or Download .txt to keep it.

What this tool does

Base64 is a way of writing any data — text, but also images, keys or files — using only 64 safe characters: A–Z, a–z, 0–9, plus + and /, with = as padding at the end. It is not encryption and it is not compression. Its whole job is to survive systems that only expect plain text, without a stray byte getting mangled along the way.

Encoding takes every three bytes of your input (24 bits) and rewrites them as four Base64 characters (4 × 6 bits). That is why Base64 output is always about a third larger than the input, and why the length is always a multiple of four — the trailing = signs pad the last group when the input does not divide evenly.

This encoder is UTF-8 safe. Emoji, accented letters and non-Latin scripts are turned into their UTF-8 bytes first and then encoded, so decoding gives you back exactly what you typed rather than a row of question marks.

Examples

A few round trips, so you can see the shape of the output:

TextBase64
HiSGk=
TextFizzVGV4dEZpeno=
caféY2Fmw6k=

Notice that café encodes to more characters than its four letters suggest — the accented é is two UTF-8 bytes, and Base64 counts bytes, not letters. Decoding VGV4dEZpeno= returns TextFizz unchanged.

When you need it

Base64 shows up wherever text-only channels have to carry data that is not plain text:

Because it is reversible by anyone, Base64 is a transport format, not a security measure — see the FAQ below.

Base64 vs Base64url

Standard Base64 uses + and /, which are unsafe in URLs and file names — a / looks like a path separator and a + can be read as a space. Base64url is a small variant that swaps + for - and / for _, and often drops the = padding. It is what you see in JWTs and in many web APIs.

This tool produces and reads standard Base64. If you are decoding a JWT or a URL-safe token, replace - with + and _ with / first, and the string will decode cleanly.

Doing it without this tool

Command line (Linux/macOS): echo -n 'TextFizz' | base64 to encode, and echo 'VGV4dEZpeno=' | base64 -d to decode.

Browser console: btoa('Hi') and atob('SGk=') — but note the built-in btoa breaks on non-Latin characters, which is exactly the case this page handles for you.

Python: import base64; base64.b64encode(b'TextFizz') and base64.b64decode('VGV4dEZpeno=').

PowerShell: [Convert]::ToBase64String([Text.Encoding]::UTF8.GetBytes('TextFizz')).

Privacy: your text never leaves your browser

The encoder and decoder are a few lines of JavaScript that run on your device. No text is uploaded, nothing is logged, and the page keeps working offline once it has loaded.

That matters here more than on most tools: Base64 often carries tokens, keys and config values. Because the conversion happens locally, you can paste that kind of string without it ever touching a server.

Related tools

Markdown tablePaste CSV, TSV or spreadsheet cells and get a clean Markdown table.Capitalize linesCapitalises the start of every line, or every sentence, without touching the…URL encode / decodePercent-encode text for safe URLs, or decode %20-style URLs back to text.Morse codeTurn text into dots and dashes, or decode Morse back to words. Everything runs…Dice rollerRoll a d6, a d20, two d6 or percentile dice. Sums included.Coin flipHeads or tails in one tap, with a running tally.Magic 8 ballAsk a yes or no question. The ball answers.

See all text tools →

Frequently asked questions

Is Base64 a form of encryption?

No. Anyone can decode Base64 in seconds — it hides nothing. It is a way to represent data as safe text, not a way to keep it secret. Never use it to protect passwords or private data.

Why is my encoded text longer than the original?

Base64 rewrites every three bytes as four characters, so the output is about 33% larger. The trailing = signs pad the final group.

Does this handle emoji and accented letters?

Yes. Text is converted to UTF-8 bytes before encoding, so emoji, accents and non-Latin scripts survive a full encode-then-decode round trip.

My Base64 will not decode — why?

Common causes are missing = padding, stray spaces or line breaks, or a Base64url string using - and _. Replace - with + and _ with /, remove whitespace, and try again.

What is the = at the end?

It is padding. Base64 works in groups of four characters; when the input does not divide evenly, one or two = signs fill the last group.

Can I decode a JWT here?

You can decode each part after splitting on the dots, but JWTs use Base64url — swap - for + and _ for / first. The signature part is not meant to be human-readable.

Is there a size limit?

Only your browser memory. Everything runs locally, so there is no upload limit, but very large inputs will use more RAM.