All tools

Base64 Encoder/Decoder

Base64 Decoder and Encoder — Encode or Decode Base64 Online

Cryptic Base64 in logs and payloads slows you down. Decode to readable text or encode any text or file — URL-safe, UTF-8 safe, and instant in your browser.

Mode

Upload any file

Processing runs in your browser. Signed-in uploads and downloaded results are saved privately to My Work within your storage allowance.

Input
Output

How to encode and decode Base64 text and files, including URL-safe Base64

This Base64 tool turns text or any file into a Base64 string and decodes Base64 back into readable text or the original file. Paste text, or drop a file, then choose Encode or Decode and read the result below. A URL-safe option covers strings that travel in links and tokens. It reads and writes text as UTF-8, so accented letters, other scripts and emoji survive the round trip.

Encode text or a file to Base64

Leave Mode on Encode and paste your text into Input. Hello becomes SGVsbG8=, and café becomes Y2Fmw6k=, because the accented letter is two UTF-8 bytes. To encode a file, drop it onto the upload strip or choose it, and the output is a data URL that begins with data: and the file type, ready for an HTML or CSS source attribute. Base64 is about a third longer than the original, so compress an image first if the string will sit in code. Long outputs are shortened on screen, but Copy and Download use the full result.

  1. Keep Mode on Encode.
  2. Paste text into Input, or drop a file onto the upload strip.
  3. Tick URL-safe if the string will sit in a link or a token.
  4. Select Copy, or Download to save a .txt file.

Decode a Base64 string back to text

Switch Mode to Decode and paste the string. A leading data:...;base64, prefix and any spaces or line breaks are removed first, so a wrapped block decodes like a single line, and a missing = at the end is accepted, so SGVsbG8 decodes to Hello just like SGVsbG8=. If the characters are not valid, or the text is cut off, you see a message saying so. Decoded bytes are shown as UTF-8 text, so text that another system encoded as Latin-1 or UTF-16 appears with replacement characters.

Use URL-safe Base64 for links, filenames and tokens

URL-safe Base64 replaces + with - and / with _, and drops the trailing =, so the string needs no escaping in a query string or filename. The three question marks ??? encode to Pz8/ in standard Base64 and to Pz8_ in URL-safe form. When decoding, tick URL-safe if the string contains - or _. This is the form used for the parts of a token, so to read a whole one, open it in the JWT decoder. File uploads always use the standard alphabet.

Turn Base64 or a data URL back into a file

In Decode mode, paste a data URL or a Base64 string and, when it decodes, Download as file saves the original bytes. The extension comes from the type in the data URL, such as png, jpg or pdf, and a bare string with no type is saved as .bin, so rename it to the right extension. Download alone saves the readable text version. If the decoded file is an image, convert it to another format when you need a different type.

Before you rely on a Base64 result

  • Remember that Base64 is encoding, not encryption, and anyone can decode it.
  • Expect the Base64 form to be about one third larger than the original.
  • Match the character set: this tool reads and writes UTF-8 text.
  • Tick URL-safe for strings that use - and _ instead of + and /.
  • While signed in, uploaded files and downloaded results are also saved privately to My Work.

A string made of three dot-separated Base64URL parts is likely a JWT, so open its header and payload in the token reader. For values inside a query string, percent-encode them instead, and to confirm a decoded file matches the original byte for byte, compare their SHA-256 fingerprints.

What you can do with Base64 Encoder/Decoder

Review the main capabilities before you begin.

  • Encode text or files to Base64 instantly
  • Decode Base64 strings back to readable text
  • Generate URL-safe Base64 for query strings
  • Encode images and other files to Base64
  • Handle UTF-8 and emoji without corruption
  • Embed assets inline in code or emails

Settings reference

Available controls for Base64 Encoder/Decoder.

Mode

ModePresets
Switches between converting plain text into Base64 (Encode) and turning Base64 or a data URL back into readable text or the original file (Decode).Options: EncodeDecode
URL-safeOn / Off
Uses the URL-safe Base64 alphabet, swapping + and / for - and _ and dropping = padding, so results can be placed in URLs and filenames; file uploads always use standard Base64.
Free to use · No signup required · Without watermarkUploads are encrypted in transitRemoved under our retention policy

Frequently Asked Questions

How Base64 Encoder/Decoder helps you get it done

Real problems it solves every day — for businesses, creators, and everyday tasks. Find the use case that fits you and start.

Web & SEO

Embed Images in HTML & CSS as Data URLs

Inline small icons, logos and SVG sprites as Base64 data URLs to save HTTP requests, ship single-file HTML emails and keep prototypes self-contained without external asset hosting

For Developers

API Authentication & Bearer Tokens

Build HTTP Basic auth headers, decode bearer tokens during API debugging and inspect base64-wrapped credentials shared in Postman, curl examples and OpenAPI docs

For Developers

Encoding Files for JSON & GraphQL Payloads

Wrap binary uploads (PDFs, images, audio clips) as Base64 strings so they ride safely inside JSON, GraphQL mutations and webhook bodies that only carry text

Everyday Use

Decoding Email MIME Attachments

Pull base64-encoded attachments out of raw .eml files, SMTP logs or IMAP responses to recover lost invoices, screenshots and documents from email exports

Web & SEO

URL-Safe Tokens for Web Apps

Generate URL-safe base64 strings for password-reset links, email-verification codes, share IDs and short URLs without breaking on "+" or "/" characters in browsers

For Developers

Inspecting JWT Segments by Hand

Decode the header and payload segments of a JSON Web Token during local debugging when you do not have a full JWT decoder installed in your terminal or editor

For Developers

Store Certificates & Keystores in CI/CD Secrets

Encode SSL certificates, Android signing keystores or a GCP service-account JSON file to Base64 so they can be pasted into GitHub Actions, GitLab CI or Vercel environment variables that only accept plain text.

Everyday Use

Rescue Files Shared as Raw Base64 Text

Paste a base64 blob copied from a Slack message, bug report or email into Decode mode and use Download as file to recover the original image or PDF someone sent you as text instead of an attachment.

For Developers

Mock API Responses Without a Backend

Generate base64 placeholder images or binary payloads to drop straight into Postman collections, MSW handlers or Swagger examples while the real backend endpoint is still being built.

For Developers

Debug Webhook Signature Payloads

Inspect the base64-encoded body Stripe, Twilio or another provider sends with a webhook so you can manually verify a signature or replay a payload while building an integration locally.

For Developers

Recover Files from Base64 API Payloads

Decode base64 to PDF, image or any other binary returned by an API or stored in a database column, then download the original file for inspection — no scripting required.

Watch each transformation land

Every photo crosses the slash untouched and comes out the other side finished.