Base64 Encode and Decode

Encode text or a file as Base64, or decode Base64 back. If the decoded data is an image, a PDF or a ZIP, its type is detected and it downloads with the right extension; your data stays on your device.

  • Text becomes Base64
  • No sign-up
  • Runs on your device

62 Base64 Encode and Decode

  1. 01 Pick
  2. 02 Process
  3. 03 Download

Processed on your device · no upload

Direction
Source

Live status

Reading the file

Result

Ready.

0files ready

0 BYour data sent to our server: 0 bytes · processed on your deviceWhy 0: this page's security rule blocks sending data at browser level; everything happens in this tab. CSP · connect-src 'none' · form-action 'none'

Couldn't convert the file.

Base64 is not encryption; it does not hide data, it only turns it into text.

  • The work is done in this tab, on your device.
  • Base64 is not encryption: anyone can decode it.
  • No file is sent to our server; closing the tab clears everything.

Type or paste your text first

Stages

  1. Reading the file
  2. Preparing Base64
  3. Preparing the file

01

What is Base64 and what is it for?

Base64 is an encoding that turns binary data (an image, a PDF, a key…) into plain text made only of letters, digits, “+” and “/”. Email attachments, small images embedded in web pages (data: URIs), files carried inside JSON or XML and many APIs travel this way. Encoded data grows by about a third.

Base64 is not encryption: anyone can decode it in seconds. It is not meant for hiding passwords or secrets; it only lets data pass unharmed through places that accept text. Because “+” and “/” cause trouble in web addresses and file names, there is also a URL-safe variant that uses “-” and “_”.

This tool encodes text as UTF-8 and files byte by byte. When decoding, it cleans up spaces, line breaks, missing “=” padding and a “data:…;base64,” prefix by itself. If the decoded data is a file, its type (PNG, JPG, PDF, ZIP, DOCX, MP3…) is identified from its first bytes and it downloads with the right extension. Everything runs in your browser; nothing is sent to a server.

02

Encode and decode Base64 in 3 steps

  1. Choose a direction: Pick “Encode” and type your text, or switch to “File” and choose a file; pick “Decode” and paste the Base64 text or open it from a .txt file.

  2. Check the result: The result appears as you type. Decoded text shows in the box; a decoded file shows its type and size, with a preview for images. If there is an invalid character, its position is shown.

  3. Copy or download: Take short results with “Copy”; “Download result” saves the Base64 as a .txt file and a decoded file with its proper extension.

03

Where Base64 turns up

  • Developers: Reading Base64 fields in API requests, preparing test data, embedding a file in JSON.

  • Web design: Creating a data: URI to embed a small icon or image in CSS or HTML.

  • Email and sysadmins: Decoding a Base64 attachment from an email's source to get the file back.

  • Integrations: Turning the PDFs and images that invoicing, payment or shipping services return as Base64 into files.

  • Debugging and security: Seeing what is inside a key, a token or a configuration value.

  • Learning: Seeing why the Base64 version of a text is a third longer and where the “=” padding comes from.

04

Rules, limits and privacy

  • Standards: RFC 4648 Base64 and URL-safe Base64 (“-” and “_”, no padding) are supported. On request the output is wrapped at 76 characters per line (MIME email format).

  • Text encoding: Text is encoded as UTF-8, so accented letters, other scripts and emoji survive the round trip. Decoded bytes that form valid UTF-8 text are shown as text.

  • Forgiving decoding: Spaces, line breaks, missing “=” and a “data:…;base64,” prefix are no problem. A character that is not part of Base64 stops decoding, and its position is shown.

  • File type: The type is found from the file's first bytes, not from a name: PNG, JPG, GIF, WEBP, PDF, ZIP, DOCX, XLSX, MP3, MP4, SVG, JSON and more. Unrecognised data downloads as .bin.

  • Base64 is not a password: Anyone can decode encoded data. Storing passwords or personal data safely requires encryption; this tool does not encrypt.

  • Limits and privacy: Files can be up to 50 MB; inputs over 300,000 characters or 2 MB are processed in the background with “Download result”. Your data is not uploaded or stored.

05

Privacy and automatic deletion

This tool does not send your file to our server: all processing happens in your browser, on your device. The page is served with a security policy (Content-Security-Policy) that technically prevents the file's contents from being sent anywhere; no analytics or advertising scripts run on this page.

The result file is also created on your device and only you download it. It is cleared from the browser's memory when you close the tab or choose “New file”. Our server keeps no file name or content record of this processing.

Read our Privacy Policy for details

06

Frequently Asked Questions

Is Base64 a form of encryption?

No. Base64 only turns data into text; there is no key and anyone can decode it. Encoding a password or a secret as Base64 does not protect it.

How do I know what kind of file a Base64 string contains?

The tool looks at the first bytes of the decoded data: files such as PNG, JPG, PDF, ZIP, DOCX and MP3 each start with their own signature. If the type is found, it is shown on screen, images get a preview, and the file downloads with the right extension.

What does an “invalid character” error mean?

Base64 only uses A–Z, a–z, 0–9, “+” and “/” (“-” and “_” in the URL-safe variant) plus “=” at the end. If another character slipped in, for example a quote or a full stop while copying, the tool shows the character and its position so you can delete it.

When do I need URL-safe Base64?

When the Base64 text goes into a web address, a file name or a token such as a JWT, “+” and “/” cause problems. The URL-safe option uses “-” and “_” instead and drops the “=” padding. Both variants are recognised automatically when decoding.

How do I embed an image in HTML or CSS?

Choose “Encode” and “File”, pick the image and turn on “data: URI”. Paste the resulting “data:image/png;base64,…” text into an img tag's src attribute or into url() in CSS. This is best for small icons; large images make the page heavier.

Why does a file get bigger when encoded as Base64?

Base64 writes every 3 bytes as 4 characters, so the output is about 33 percent larger. Wrapping lines at 76 characters adds line breaks and makes it slightly larger still.

Is my data sent to a server?

No. Encoding and decoding happen in your browser, and the page comes with a security policy that technically blocks connections to the outside. You can safely use it with tokens and files that contain personal data.

One more file?

Drag · drop · convertChoose a file