FreeURL & Encoding tool

Base64 Encoder / Decoder

Type or paste text on the Encode tab to get its Base64 form, or paste a Base64 string on the Decode tab to turn it back into readable text. The conversion uses your browser's built-in functions, so what you paste stays in the tab.

Encode and decode tabsUTF-8 safe for any textNo upload, runs locally

Updated · by the Linkstonic team

linkstonic.com/tool/base64-encoder-decoderLive
How it works

What happens to your text

Base64 is a fixed standard, so the interesting parts are the edges: non-English text, bad input and what the tool won't accept.

01

UTF-8 first

Before encoding, the text is converted to UTF-8 bytes, then those bytes go through the browser's btoa function. That is why "é", "€" or an emoji encode without errors. Plain btoa on its own throws an error on any character outside Latin-1, which trips up a lot of quick scripts.

02

Size grows by a third

Every 3 bytes of input become 4 Base64 characters. When the byte count isn't a multiple of 3, the output is padded with one or two "=" signs. So 16 bytes of text always come out as 24 characters, two of them padding.

03

Decoding and errors

Decoding runs atob, then reads the bytes as UTF-8. If the string has characters outside the Base64 alphabet, or decodes to bytes that aren't valid UTF-8 text, the output box shows an "Error decoding" message flagging invalid Base64 instead of printing garbage.

04

Forgiving about spacing

Line breaks and spaces inside the string are ignored, so Base64 copied from an email header or wrapped at 76 characters decodes fine. Missing "=" padding is also tolerated, as long as the length isn't one character past a multiple of four.

05

Standard alphabet only

The URL-safe variant, which swaps "+" and "/" for "-" and "_", fails here. That variant shows up in JWTs and some API tokens. Swap those two characters back by hand before decoding.

06

One shared box

The Encode and Decode tabs share the same input and output. Switch tabs and your text comes with you, which makes a round-trip check quick: encode, copy the result, paste it back on Decode.

Worked example

Encoding a line with accents

We typed a short menu line with an accented letter and a euro sign. Both are multi-byte in UTF-8, which is where naive encoders break.

Input
Café menu: 5€
Output
13Characters typed
16UTF-8 bytes
24Base64 characters
2Padding "=" signs
Q2Fmw6kgbWVudTogNeKCrA==Encoded output

Thirteen characters become sixteen bytes because "é" takes two bytes and "€" takes three. Sixteen isn't a multiple of three, so the output ends in two "=" signs.

Use cases

Where Base64 turns up at work

Most people meet Base64 by accident, in a config file or an API response. These are the usual spots.

Developers testing APIs

HTTP Basic auth sends "user:password" as Base64 in a header. Decoding a captured header shows which account a request used. Encoding a test pair builds the header by hand. Use test credentials, never production ones.

Email and support staff

Email headers and MIME parts are often Base64 encoded. Decoding a subject line or a short text part shows what the message actually said when a mail client mangles it.

Marketers reading tracking links

Some ad and email platforms pack campaign data into a Base64 query parameter. Decoding it shows which campaign, list or user ID a link carries, which helps when attribution looks wrong.

Base64 Encoder / Decoder illustration: a link icon next to a sample result card showing 13 characters typed and 16 UTF-8 bytes
Base64 Encoder / Decoder, sample result
Our take

Base64 is packaging, not protection

The most common mistake I see is treating Base64 as a way to hide something. It isn't encryption. Anyone can paste the string into a tool like this one and read it in a second. If a password, API key or customer email is sitting in a config file or URL as Base64, treat it as plain text that is out in the open.

What Base64 is good at is moving binary or awkward characters through systems built for plain text: email bodies, JSON fields, data URIs in CSS, HTTP headers. It costs about 33 percent in size, so a 30 KB image inlined as a data URI adds roughly 40 KB to the file that holds it.

For SEO, that size cost is the part to watch. Inlining large images as Base64 in HTML or CSS makes the page heavier and stops the browser caching the image separately. Small icons are fine. Search engines and AI crawlers read the text around your images, not the encoded blob, so a big inline image gives them nothing extra to work with.

Practical tips

Fixing a string that won't decode

Most decode errors come from copy and paste, not from the data itself.

  1. 01

    Check the ends. A stray quote mark or a missing last character is the most common cause of an error.

  2. 02

    If you see "-" or "_", it is URL-safe Base64. Replace them with "+" and "/" and try again.

  3. 03

    Strip any prefix like "data:image/png;base64," before decoding. Only the part after the comma is Base64.

  4. 04

    An error on a long string that looks valid may mean it holds an image or a file, not text. This tool decodes text only.

  5. 05

    Round-trip your own output: encode, copy, switch to Decode, press the button. You should get the original back exactly.

Base64 Encoder / Decoder tips illustration: a checklist card that starts with "Check the ends" and "If you see - or _, it is URL-safe Base64"
Base64 Encoder / Decoder, checklist
Our customers

How we help marketers win

01techventuresShare of voice
02northlineReporting time
03arclabsAI mentions
FAQ

Base64 Encoder / Decoder questions

01Is my text sent to a server when I encode or decode?

No. Both directions use the browser's built-in btoa and atob functions, so the text is processed inside your tab. Nothing you paste is uploaded to Linkstonic.

02Is Base64 encryption?

No. Base64 is an encoding that anyone can reverse without a key. It makes data safe to move through text-only systems, but it hides nothing. Use real encryption for anything sensitive.

03Why do I get "invalid Base64" when decoding?

The string either contains characters outside the standard alphabet, such as "-" or "_" from URL-safe Base64, or it decodes to bytes that aren't UTF-8 text, like an image. Trim stray characters and check the variant.

04Can I encode an image or a PDF?

Not with this tool. It takes typed or pasted text only, with no file upload. For images, a data URI generator or your build tool is the better route.

05Why is the Base64 output longer than my text?

Base64 turns every 3 bytes into 4 characters, so output is about a third larger. Accented letters and emoji take two to four bytes each in UTF-8, which adds a bit more.

Beyond one-off checks

See how your pages do in Google and AI answers

Linkstonic tracks rankings, audits your site and shows whether ChatGPT, Gemini and Perplexity mention you. The free plan needs no credit card.