ToolsGuru

Base64 Encoder/Decoder

Convert text and files to Base64 and back with advanced options

Text Encoding
File Encoding
URL-Safe Mode
Multiple Encodings
Real-time Conversion
Conversion Settings
Text Input
Base64 Output
About Base64 Encoding

Standard Base64

Uses characters A-Z, a-z, 0-9, +, / with = padding. Most common encoding for data transmission.

URL-Safe Base64

Replaces + with - and / with _ for safe use in URLs and filenames. Removes padding characters.

Use Cases

  • Email attachments (MIME encoding)
  • Data URLs for images in CSS/HTML
  • API token encoding
  • Binary data transmission over text protocols
  • Configuration file data embedding

Note: All conversions are performed locally in your browser. No data is sent to external servers.

Maximum text size: 1 MB | Maximum file size: 10 MB

Encode and decode Base64 — text, files, and images

Base64 is the encoding scheme behind data URIs, JWT tokens, email attachments, API payloads and embedded credentials. Our free online Base64 encoder/decoder converts between text, binary files and Base64 strings instantly in your browser, supporting the whole UTF‑8 character set as well as URL‑safe Base64 variants.

Developers reach for Base64 dozens of times a day — embedding small images directly into CSS, decoding JWT payloads to inspect claims, encoding API keys for HTTP basic auth, or transporting binary blobs through JSON. This tool handles all of those workflows in a single clean interface without leaking sensitive data to a server.

Because conversion runs locally, you can paste production tokens, customer data, or proprietary keys without any privacy concern. The tool also displays decoded output in friendly form so you can verify that the encoded value actually contains what you think it does.

Why use Base64 Encoder/Decoder?

Encode any file or text

From plain UTF‑8 strings to whole binary files, everything can become Base64.

Decode without surprises

See decoded results immediately, with binary downloads where appropriate.

URL‑safe variant

Switch between standard and URL‑safe Base64 for tokens that need to travel in URLs.

Private by default

Tokens and sensitive payloads never leave your browser, so secrets stay secret.

How to use Base64 Encoder/Decoder

  1. 1

    Pick a mode

    Choose encode or decode, and text or file mode depending on your input.

  2. 2

    Paste text or upload a file

    Drop your input into the editor or pick a file from disk.

  3. 3

    Read the result

    Encoded or decoded output appears instantly in the output pane.

  4. 4

    Copy or download

    Click to copy the encoded string, or download decoded files to disk.

Common use cases

Embed images in CSS or HTML

Convert small icons to Base64 data URIs to remove extra HTTP requests.

Inspect JWT tokens

Decode the payload portion of a JWT to verify its claims and expiry.

Transport binaries via JSON

Encode binary attachments to send through APIs that only accept text.

Build HTTP Basic Auth headers

Encode "username:password" strings to drop straight into Authorization headers.

Worked example: Tiny SVG icon into a CSS data URI

A front-end developer had a 612-byte SVG chevron that was not worth an extra HTTP request on a marketing landing page. They encoded it to Base64 in the browser and dropped `url('data:image/svg+xml;base64,…')` into the stylesheet. The Network panel then showed one fewer file on first load.

They also used decode mode later when an email from a payment provider included a Base64 attachment blob in a JSON field. Decoding locally meant the receipt PDF never went to an online decoder of unknown ownership.

Limitations

When not to use Base64 Encoder/Decoder

Features at a glance

Frequently asked questions

How do I encode text to Base64 online?

Type or paste your text into the input field and click Encode. The Base64 encoded string appears instantly in the output field.

How do I decode a Base64 string?

Paste your Base64-encoded string into the input, switch to Decode mode, and click Decode. The original text or data appears in the output.

What is Base64 used for?

Base64 is used to encode binary data in text-safe formats, commonly for email attachments, embedding images in HTML/CSS via data URIs, and transmitting data in JSON APIs.

Can I encode URLs to Base64?

Yes. You can encode any text, including URLs, to Base64. Our tool also supports URL-safe Base64 encoding which replaces + with - and / with _.

Your privacy matters

Base64 Encoder/Decoder is designed to run in your web browser. File and text tools process bytes in memory on your device rather than uploading them to a ToolsGuru converter API. Network requests you still see are the page itself, analytics, and ads — not a copy of your document sitting in our logs. How we process files, and how to check.

Related tools you might like

Guides that go with this tool