Base64 converter

Encode text or files such as images to Base64, or decode Base64 back to the original text or file.

Text or file

0 characters · 0 lines

Direction

0 characters · 0 lines

Everything runs on this device. What you enter is never sent anywhere.

Base64 isn't encryption. Anyone can decode it, so don't use it to hide passwords or other secrets.

Found it useful? We'd love a share

Something not working, or an idea to make it better?

How to use

  1. 1. Enter text

    Tap “Paste” to put in the text you copied. You can also type straight into the box. The Base64 appears below right away. To encode an image or other file, open it with “File”.

  2. 2. Choose a format

    In the bar above the result, tap “URL-safe” to turn + / into - _ and drop the trailing =. Tap “data URL” to add a type starting with data: at the beginning. The result below changes instantly.

  3. 3. Copy or save

    Tap “Copy” below the result to copy the Base64. Tap “Download text” to save it as a .txt file. For an image turned into a data URL, “Copy as HTML” and “Copy as CSS” copy it ready to use as an img tag or a background-image.

  4. 4. Decode Base64

    Tap “Decode” in the bar, then tap “Paste” above the box to put in the Base64. Text appears below as is. An image is shown below, and you can tap “Download file” to save it as an image file. Paste an email subject or sender like “=?UTF-8?B?…?=” and it turns back into the original text too.

Great for

  • Reading an email subject or API response

    Paste a subject or sender that shows up as “=?ISO-2022-JP?B?…?=” in an email's source, or Base64 from an API response, and it turns back into readable text, including non-English characters. Legacy encodings such as Shift_JIS and the Q form (=E3=81=82) work too.

    Web developers and support staff

  • Embedding images in HTML or CSS

    Open a small image such as an icon and click “data URL”. “Copy as HTML” copies it as <img src="…">, and “Copy as CSS” as background-image: url("…").

    Web designers and front-end developers

  • Putting data in a URL or JSON

    Turn on “URL-safe” to get the same - _ form used in URL parameters and JWTs, so nothing breaks when you paste it.

    Anyone testing APIs

  • Turning Base64 back into a file

    Paste a Base64 image or PDF from a log or config, and it identifies the type and saves it as a file with the right extension.

    Developers and people who work with data

Good to know

  • Base64 isn't encryption. Anyone can decode it, so don't use it to hide passwords or other secrets.
  • Base64 makes data about 1.33 times larger. Turning a large image into a data URL makes your HTML heavier.
  • Files up to 30 MB can be encoded. Larger files can make some devices slow.

About Base64

Base64 is a way to write data such as images using only 64 characters: letters, digits, “+” and “/”. Every 3 bytes become 4 characters, so the size grows by about 1.33 times. It's used to carry data through places that only accept text, such as email attachments, data URLs, JWTs and API authentication (Basic auth).

This tool always converts text to UTF-8 first, so non-English text and emoji never get garbled. When decoding, it reads the input as is, even with line breaks or spaces, URL-safe - _, a missing trailing =, or a data URL prefix. Text is shown as text, images are displayed, and other files are identified by type so you can save them.

Base64 formats compared
What it looks likeUsed for
Standard Base64A–Z a–z 0–9 + / with = at the endEmail, API data and config files
URL-safe- _ instead of + /, no =URL parameters, file names and JWTs
Wrap at 76A line break every 76 charactersEmail attachments (MIME)
data URLStarts with data:image/png;base64,Embedding images in HTML img tags or CSS backgrounds

FAQ

Answers to common questions before you start.

Is my text or file sent anywhere?

No. Encoding and decoding happen entirely in your device's browser, and nothing you enter is sent to a server.

Will non-English text get garbled?

No. Text is converted to UTF-8 first, so non-English text and emoji come back exactly as they were. When decoding, if it can't be read as UTF-8, it checks whether it was written in a legacy Japanese encoding such as Shift_JIS or EUC-JP.

How do I convert an image to Base64?

With “Encode” selected, click “Open file” and pick an image, or drag an image onto the page. The Base64 appears right away. To use it in HTML or CSS, turn on “data URL”.

Can I turn Base64 back into an image or file?

Yes. Switch to “Decode” and paste the Base64. If it's an image, it's displayed, and you can save it with “Download file”. PNG, JPEG, PDF, ZIP and more are identified from their content and given the right extension.

My email subject looks like “=?UTF-8?B?…?=”

That's the form used to send email subjects and senders using only letters and numbers (MIME encoding). Switch to “Decode” and paste the line: it turns back into the original text, and the character set it read (UTF-8, ISO-2022-JP and so on) appears above the result. Several in a row and folded lines are read together.

What is URL-safe?

It's a form that replaces “+” and “/”, which have special meanings in URLs and file names, with “-” and “_”, and drops the trailing “=” (base64url). It's used in JWTs and URL parameters. When decoding, either form is read automatically.

What is a data URL?

It's Base64 with the data type added at the start, like “data:image/png;base64,”. Put it in an HTML img src or a CSS url() to show the image without loading a separate file. For images, “Copy as HTML” and “Copy as CSS” copy it in a ready-to-paste form.

It says “This can't be read as Base64”

Either there's a character Base64 can't use, or part of it was cut off when you copied it. The line and column are shown, and the spot is marked in orange in the input box, so check there. Don't worry about line breaks, spaces, or whether there's a trailing =.

Is Base64 encryption?

No. It just swaps data for characters using a fixed table, so anyone can decode it. Don't use it to hide passwords or personal information.

Can it handle large files?

Files up to 30 MB can be encoded. When the result is very long, only the first part is shown in the box, but “Copy” and “Download text” use the whole thing.

Is it free?

Yes, it's free. No sign-up and no ads.

  • Hiragana ⇔ katakana converter

    Convert between hiragana, katakana and half-width katakana in one go. Kanji, letters and numbers are left as they are.

  • JSON formatter

    Pretty-print JSON or minify it to one line. If there's a mistake, it shows you where.

  • URL Encode / Decode

    Encode text and symbols into a URL-safe form (like %C3%A9) or decode it back to the original text.

  • Password generator

    Choose the length and characters to make hard-to-guess passwords on the spot.

  • Text compare

    Compare two texts and highlight the differences, down to the word and character.

  • Copy Symbols & Special Characters

    Tap to copy hearts, arrows, box drawing, brackets, units and other symbols. You can also search them by name.