Free Developer Tool

Base64 Encoder and Decoder

Use this Base64 encoder to turn any text, file or image into a Base64 string, then decode Base64 back to readable text in the same window. Everything runs inside your browser, so your data never leaves your device.

  • 100% browser based
  • No upload, no tracking
  • UTF-8 and emoji safe
  • URL-safe Base64 support
0 chars
0 chars
Preview of the decoded image
Image detected

Ready. Start typing and the conversion runs as you type.

Why this Base64 converter beats the usual options

Most Base64 tools give you two plain boxes and a wall of ads. This one adds the options developers actually reach for, and it keeps every byte on your machine.

Live two-way conversion

Results update as you type. Hit the swap button to flip the panels and switch between encode and decode in one click.

Nothing is uploaded

All encoding and decoding happens in JavaScript on your device. Tokens, keys and private payloads never touch a server.

URL-safe Base64

One toggle switches to the base64url alphabet, so plus and slash become minus and underscore and padding is dropped.

Files and images

Load a PNG, PDF or any binary file and get a clean Base64 string or a ready to paste data URI for CSS and HTML.

Real error messages

If a Base64 string is truncated or contains an illegal character, the tool tells you what is wrong instead of failing silently.

Built for mobile

Large tap targets, readable monospace output and a layout that stacks cleanly on a phone. Keyboard users get visible focus too.

How to encode and decode Base64 online

  1. Pick your direction

    Choose Encode to convert text to Base64, or Decode to convert a Base64 string back to plain text.

  2. Add your content

    Paste text into the left panel, or press Load file to encode an image, PDF or any other file from your device.

  3. Set the options you need

    Turn on URL-safe for tokens and query strings, Wrap 76 chars for MIME and email payloads, or Data URI to embed a file directly in CSS or HTML.

  4. Copy or download

    Press Copy result for the clipboard, or Download to save the output as a file. Decoded images show a preview before you save them.

What Base64 is and when you actually need it

Base64 is an encoding scheme that represents binary data using 64 printable ASCII characters. It is not encryption and it hides nothing. Its job is to move binary safely through channels that only expect text, such as email bodies, JSON fields, HTML attributes and URLs.

  • Email attachments. MIME wraps binary files in Base64 so mail servers can pass them along as plain text.
  • Data URIs. Small icons and fonts get embedded straight into CSS or HTML, which removes an extra network request.
  • API payloads. JSON has no binary type, so images, certificates and signatures usually travel as Base64 strings.
  • JWT tokens. Each part of a JSON Web Token is base64url encoded, which is why the URL-safe toggle matters.
  • Basic authentication. The classic Authorization header carries a Base64 encoded user and password pair.
  • Config and secrets. Kubernetes secrets and many CI systems store values as Base64 for safe transport, not for secrecy.
Size impact of Base64 encoding
Original sizeBase64 sizeOverhead
1 KB1.37 KBAbout 37 percent with padding
100 KB137 KBRoughly a third larger
1 MB1.37 MBAvoid for large media files

Every three bytes become four characters, so expect around 33 percent growth before padding and line breaks. That trade is fine for a 2 KB logo and wasteful for a 3 MB photo.

Benefits of using a browser based Base64 tool

  • Privacy by design. Nothing is posted to a server, so you can safely decode a token you would never paste into a random website.
  • Speed. There is no round trip. Even a few hundred kilobytes convert instantly on a mid range phone.
  • Correct Unicode handling. The tool encodes through UTF-8, so accents, Chinese characters and emoji survive the round trip intact.
  • Works offline. Once the page has loaded, the converter keeps working even if your connection drops.
  • Fewer mistakes. Clear validation catches the missing padding and stray whitespace that break most copy and paste jobs.

Base64 encoder and decoder FAQ

Is Base64 encoding the same as encryption?
No. Base64 is a reversible encoding that anyone can undo in seconds, and this page proves it. It protects data during transport, not from people. If you need secrecy, use real encryption such as AES or TLS and treat Base64 only as a container.
How do I decode a Base64 string back to text?
Select Decode, paste the string into the left panel and read the plain text on the right. The tool strips line breaks and spaces automatically, repairs missing padding where it can, and accepts both standard Base64 and the URL-safe variant.
What is URL-safe Base64 and when should I use it?
URL-safe Base64, also called base64url, swaps the plus and slash characters for minus and underscore and usually drops the equals padding. Use it for JWT tokens, query string parameters and filenames, because the standard characters have special meaning in URLs.
Can I convert an image to Base64 here?
Yes. Press Load file, choose a PNG, JPG, SVG, GIF or WebP file, and the encoder returns the Base64 string. Turn on Data URI to get the full data:image prefix that you can paste straight into a CSS background or an img src attribute.
Why does my Base64 string fail to decode?
Three causes cover almost every case. The string was truncated during copy and paste, it contains characters outside the Base64 alphabet, or its length is not a multiple of four because padding was removed. The status line names the exact problem so you can fix the source.
Does Base64 make my file bigger?
Yes, by about a third. Three bytes of input become four characters of output, and padding plus optional line breaks add a little more. Embed small assets like icons and inline fonts, and keep large images as normal file requests.
Is my data sent to your server?
Never. The converter runs entirely in your browser using native JavaScript. No text, file or result is transmitted, logged or stored anywhere, which makes it safe for API keys, tokens and internal documents.
Does it handle emoji and non English characters?
Yes. Text is converted through UTF-8 before encoding and decoded the same way, so accented letters, Cyrillic, Arabic, Chinese, Japanese and emoji all round trip without corruption.

Encode or decode Base64 in one click

Bookmark this Base64 encoder and decoder for the next time a token, config value or embedded image lands on your desk. It is free, it stays private, and it works on any device.

Browse all free tools
Scroll to Top