Skip to main content
✨ All tools are 100% free — no sign-up, no limits, instant results!
✅ Done!
🔢 Calculators
Basic Calculator Scientific Calculator Percentage Calculator Loan Calculator Mortgage Calculator Interest Calculator BMI Calculator CGPA and GPA Calculator
📅 Date, Units & Words
Age Calculator Date Difference Calculator Unit Converter Number to Words Converter
✏️ Text Tools
Text Case Converter Word Counter Text Compare (Diff Checker) Remove Duplicate Lines Sort Lines Alphabetically Bijoy to Unicode Converter Image to Text Converter (OCR)
🔐 Security & SEO
HTTPS Reachability Checker Password Strength Keyword Density Meta Tag Analyzer Sitemap Generator
🖼️ Image & File Tools
Image Compressor Image Resizer Image Converter HEIC to JPG Converter Favicon Generator Free Metadata Cleaner File Converter
⚡ Generate
QR Code Generator Password Generator Color Picker Lorem Ipsum Generator UUID Generator
💻 Dev Tools
JSON Formatter CSS Minifier JS Minifier XML Formatter CSV to JSON JSON to CSV IP Address Lookup User Agent Parser Meta Tag Generator
🔤 Encode & Hash
Base64 Encoder URL Encoder HTML Entity Encoder Hash Generator
📄 PDF Tools
Compress PDF Merge PDF Split PDF Rotate PDF PDF Reader PDF to Text (.txt) PDF to CSV PDF to Images (ZIP) PDF to JPG JPG to PDF Sign PDF PDF Lock (Read-Only) Watermark PDF PDF Scanner Delete Pages Extract Pages Organize PDF Number Pages Crop PDF PDF Black-Out PDF Form Filler HTML to PDF (Text Only) TXT to PDF RTF to PDF ODT to PDF Flatten PDF

Base64 Encoder & Decoder – Free Online Tool

Encoding Tools

Base64 Encoder & Decoder

Paste text, press Encode to Base64 or Decode from Base64, and copy the result. Unicode text is handled correctly, so accented letters and Bengali survive the round trip.

Base64 is a way of writing arbitrary bytes using only 64 safe characters: the letters A to Z and a to z, the digits 0 to 9, plus + and /, with = used as padding. It was invented because many old protocols, email being the classic example, could only carry plain printable text. If you wanted to send a picture or a binary file through them, the bytes had to be disguised as text first. Today you meet Base64 in data URIs, JSON Web Tokens, HTTP Basic authentication headers, PEM certificates and API payloads that need to carry a small file inside a text field.

This page gives you a two-button tool for that job. You type or paste into one box, press either Encode to Base64 or Decode from Base64, and the answer appears below with a Copy button. It does one thing and does it predictably, which is exactly what you want when you are debugging a header at midnight.

How to use the encoder and decoder

  1. Click into the Input Text box and paste or type your content.
  2. To turn readable text into Base64, press Encode to Base64. The result is labelled "Encoded:".
  3. To go the other way, paste a Base64 string into the same box and press Decode from Base64. The result is labelled "Decoded:".
  4. Press the Copy button under the result to put it on your clipboard.

If you press a button with an empty box you will get a short "Enter text" message, and if the string you try to decode is not valid Base64 you will see "Invalid Base64" rather than garbage output. Leading and trailing spaces are trimmed before decoding, which helps when you copy a value out of a log line with a stray space at the end.

What the tool does to your text

Before encoding, your text is converted to UTF-8 bytes, and those bytes are what get turned into Base64. That detail matters. A naive implementation that feeds a string straight into the browser's built-in btoa function breaks as soon as the text contains anything outside basic Latin. This tool avoids the problem, so you can safely encode accented names, Bengali, Arabic or emoji. Decoding reverses the process: Base64 to bytes, then bytes read as UTF-8 text.

Input textBase64 outputNote
HelloSGVsbG8=5 bytes become 8 characters, one = pad
Hello, World!SGVsbG8sIFdvcmxkIQ==13 bytes become 20 characters, two pads
user:passdXNlcjpwYXNz9 bytes divide evenly by 3, so no padding
বাংলা4Kas4Ka+4KaC4Kay4Ka+5 characters are 15 UTF-8 bytes

Why the output is longer than the input

Base64 takes every three bytes (24 bits) and splits them into four groups of six bits. Each six-bit group indexes into the 64-character alphabet. Three bytes in, four characters out, so the encoded form is roughly one third larger than the original. When the input length is not a multiple of three, the last group is filled out with = characters: one pad when one byte is missing, two when two are missing. That is why "Hello" ends in a single equals sign and "Hello, World!" ends in two. You can use this rule as a sanity check: a valid standard Base64 string has a length that is a multiple of four.

Practical uses

  • Reading an authorization header. HTTP Basic authentication sends username:password encoded as Base64. Decoding a captured header shows you immediately whether the client is sending the credentials you expect.
  • Inspecting a JWT. The header and payload of a JSON Web Token are Base64 variants. Paste one segment, after swapping - for + and _ for /, to read the claims. Padding may need to be added by hand.
  • Embedding small assets. A tiny SVG or icon can be written into CSS as a data URI so the page needs one less request. This tool handles text, so it suits text-based assets such as SVG source.
  • Passing awkward strings through systems. Newlines, quotes and non-ASCII characters can break config files, command lines and some query parameters. Encoding the value first removes the problem.
  • Checking test fixtures. When an API returns a Base64 field you can decode it to see whether the content is what the documentation promises.

Mistakes to avoid

Base64 is not encryption. Anyone can decode it in a second, exactly as you just did. Never treat a Base64 string as a way to hide a password, API key or personal data. If something must stay secret, it needs real encryption and proper key management.

  • URL-safe variants. Some systems replace + with - and / with _ so the string can sit inside a URL. This tool decodes the standard alphabet, so convert those characters back before pasting.
  • Binary results. If the Base64 you decode represents an image, a PDF or a compressed file, the bytes are not text, and the output will look like random symbols. The tool displays decoded content as text and does not produce downloadable files.
  • Stray characters. A missing character, an extra quote mark copied from JSON, or a line break in the middle of a very long string will trigger the "Invalid Base64" message. Check the edges of what you pasted first.
  • Double encoding. If a decoded result still looks like Base64, the value was encoded twice. Press Decode again on the new output.

Where the work happens

The conversion is performed by JavaScript running on this page. The tool does not send your text to a server to be encoded, so you can use it on ordinary working data. As with any website, avoid pasting live production secrets into any online tool you do not control, simply as a habit.

Frequently asked questions

Is Base64 the same as encryption or hashing?

No. Base64 is a reversible encoding with no key, so it protects nothing. Encryption needs a secret key, and hashing is a one-way fingerprint that cannot be turned back into the original.

Why does my encoded text end with one or two equals signs?

Those are padding. Base64 works in blocks of three bytes, and when the final block is short, equals signs fill the output up to a multiple of four characters.

Can I encode Bengali, Arabic or emoji?

Yes. The text is converted to UTF-8 first, so any character your browser can display will round-trip correctly through Encode and Decode.

Why does decoding give me strange symbols?

Either the string is not Base64 of text, for example it holds an image or a compressed file, or it was encoded using a different character set. Binary data cannot be shown meaningfully as text.

Does Base64 make files smaller?

No, it makes them about 33 percent larger. Its job is compatibility with text-only channels, not compression.

Keep going

Related tools

Browse all 63 free tools →