Base64 Encoder / Decoder

Encode UTF-8 text or files as Base64 or Base64url. Decode Base64 data URLs, inspect readable text, and download original bytes locally.

Base64 Encoder / Decoder

Convert UTF-8 text or file bytes locally. Choose Standard Base64 or Base64url and download decoded bytes without replacement.

Standard encoding defaults to padding; Base64url defaults to no padding. Follow the receiving format. Decode accepts either padding form and ignores only spaces, tabs, CR, and LF.

Encoded
Up to 5 MiB (5,242,880 bytes); processed locally.

16 source bytes · 24 output characters

SGVsbG8sIFRvb2xNaW50IQ==

Copy uses the displayed text. Decode downloads the original bytes, even when they are not UTF-8. Swap requires a nonempty text result. SVG and HTML are shown only as text, never executed or previewed.

Conversions use tab memory; the tool does not upload inputs or save them in local storage. Its analytics event payloads exclude text, file contents, file names, and media types. Clipboard and downloads retain their own copies. Base64 is encoding, not encryption.

Steps

How to use

  1. Choose Encode or Decode and the required alphabet.
  2. Enter text, select a local file in Encode, or paste Base64 or a Base64 data URL in Decode.
  3. In Encode, choose padding and the file output format when applicable.
  4. Review text or byte information, then Copy or Download the appropriate result.
Examples and use cases
  • Encode accented or non-Latin UTF-8 text for an API field.
  • Convert a small local file to Base64 only or a data URL.
  • Decode an image data URL and download its original bytes.
Privacy, limits and tool details

Key facts

Alphabets
Standard Base64 (+ /) and Base64url (- _)
Padding
Selectable in Encode; Decode accepts correctly padded or unpadded input
Text
UTF-8 encoding and strict UTF-8 decoding; no replacement of invalid bytes
Byte limit
5 MiB for files, UTF-8 source bytes, and decoded bytes
File output
Base64 only or a padded Standard Base64 data URL
Decoded downloads
Original bytes; text, recognized raster image, or binary filename
Input formats
UTF-8 text, Local files up to 5 MiB, Standard Base64, Base64url, Base64 data URLs
Output formats
Base64 text, Base64url text, Base64 data URL, UTF-8 text view, Original decoded bytes
Limits
bytes: 5 MiB; decodeInput: 7,340,032 characters; dataUrlHeader: 1,024 characters before the comma
Processing method
Browser TextEncoder, chunked byte encoding, validated Base64 decoding, strict TextDecoder, and original-byte Blob downloads.
Privacy model
Inputs and results stay in tab memory; the converter does not upload them or save them in local storage. Its analytics payloads exclude text, file contents, filenames, and media types. Clipboard and downloads retain separate copies.
Account required
No
Price
Free
Browser support
Modern browsers with TextEncoder, TextDecoder, atob, btoa, Blob, and File.arrayBuffer. Copy requires clipboard access.
Main limitation
Base64 is reversible encoding and provides no encryption, authenticity, or file safety guarantee.
Privacy

Privacy and processing

Processing method: Browser TextEncoder, chunked byte encoding, validated Base64 decoding, strict TextDecoder, and original-byte Blob downloads.

Privacy model: Inputs and results stay in tab memory; the converter does not upload them or save them in local storage. Its analytics payloads exclude text, file contents, filenames, and media types. Clipboard and downloads retain separate copies.

Limitations

Limitations

  • Base64 is reversible encoding and provides no encryption, authenticity, or file safety guarantee.
  • The text view supports UTF-8 only; binary and other text encodings retain their bytes for download.
  • Data URL decoding supports only Base64 payloads and simple media-type parameters.
  • Raster image previews use signature hints; SVG and HTML are not rendered.
  • Decode ignores only ASCII space, tab, CR, and LF, accepts optional padding, and rejects non-zero unused padding bits. Receiving protocols may impose different rules.
Features

Benefits

Exact decoded bytes

Download binary results without replacing them with text characters.

Explicit variants

Choose an alphabet and encoding padding policy.

Local conversion

Process small text and file inputs in the browser.

Tips

Pro tips

  • Match the receiving protocol's alphabet and padding requirements.
  • Use JWT Decoder for complete tokens; decoding does not verify a signature.
  • A valid Base64 result may be binary rather than readable UTF-8 text.
Watch out

Common mistakes to avoid

  • Treating Base64 as encryption or a file safety check.
  • Copying replacement characters instead of downloading original bytes.
  • Passing a whole JWT, percent-encoded input, or the wrong alphabet to a raw Base64 decoder.
  • Assuming a data URL preserves its original filename or guarantees its declared type.

Sources

Detailed Base64 Encoder / Decoder guide

Encode text or file bytes as Base64

Use the Base64 Encoder / Decoder to represent UTF-8 text or a small file as a string, or recover bytes from an encoded value. Conversion runs in your browser without an account. Choose the format required by the system that will receive the result.

Base64 is reversible encoding, not encryption. It does not hide passwords, protect tokens, or prove that a file is safe. Decoded text is displayed as text; HTML and SVG are not executed or previewed.

Input Mode and controls Result
Plain text, including emoji and non-Latin scripts Encode; choose alphabet and padding Base64 representation of UTF-8 bytes
A local file Encode a file; choose Data URL or Base64 only Encoded bytes, with an optional media-type header
Raw Base64 Decode; select the matching alphabet Original bytes and text when valid UTF-8
data:...;base64,... Decode; its payload uses Standard Base64 Original payload bytes; selected raw-input alphabet is ignored

Type or paste text to update the result. Selecting a file replaces the text input. Typing text afterward replaces the selected file. Changing mode clears the file selection but retains the text input; use Swap to move a nonempty text result into the opposite mode.

Choose Standard Base64 or Base64url

Standard Base64 uses letters, digits, +, and /, with optional final = characters for padding. Encode defaults to including padding. Base64url uses - and _ instead of + and /; this tool defaults to omitting padding for that choice. The checkbox lets you change the encoding output.

The alphabet and the padding policy are separate choices. A receiving protocol may require or forbid padding. Do not remove = simply because a string is going into a URL, and do not assume that changing two characters makes every system accept it.

For the two bytes FB FF in hexadecimal:

Output choice Encoded value
Standard, padded +/8=
Base64url, padded -_8=
Base64url, unpadded -_8

In Decode, select the alphabet used by a raw string. Both choices accept correctly padded or unpadded values. The decoder ignores spaces, tabs, carriage returns, and line feeds so you can inspect wrapped input. It rejects other characters, mixed alphabets, impossible lengths, misplaced padding, and non-zero unused padding bits. These are the tool's acceptance rules; another protocol may be stricter about whitespace or require padding.

A complete JWT contains multiple parts and is not one Base64 string. Use the JWT Decoder to inspect its structure. Decoding a JWT does not verify its signature or establish trust.

Encode a file or read a Base64 data URL

Choose Encode a file… to select a local file up to 5 MiB, or 5,242,880 bytes. This is a file picker, not a drag-and-drop area. The default file output is a Base64 data URL:

data:text/plain;base64,SGVsbG8=

The header identifies a media type; the comma separates it from the encoded payload. The file's browser-reported type is used when it is a simple valid media type. Otherwise the tool uses application/octet-stream. A type label does not validate the contents, and the data URL does not preserve the original filename.

Select Base64 only to omit the header and enable alphabet and padding controls for the file bytes. Data URL output always uses padded Standard Base64.

Decode accepts Base64 data URLs with a short media-type header and simple parameters such as charset=utf-8. It does not support non-Base64 data URLs or arbitrary header syntax. The decoded bytes are preserved regardless of the declared charset; the text view attempts UTF-8 only. A charset declaration does not make the tool transcode Latin-1 or UTF-16.

Inspect text and download original bytes

A valid Base64 string can represent text, an image, an archive, or any other bytes. Successful Base64 decoding does not imply that the result is readable text.

The text view uses strict UTF-8 decoding. Accents, emoji, line breaks, spaces, and a UTF-8 byte order mark are preserved. If the bytes cannot be decoded as UTF-8, the tool explains this and disables Copy and Swap instead of substituting �. Download decoded file remains available and preserves the exact bytes.

For example, SGVsbG8= decodes to Hello. /w== decodes to the single byte FF, which is not valid UTF-8 by itself. That second result belongs in a byte download, not a replacement-character text export.

Use the JSON Formatter to inspect decoded JSON, or the Text Diff Checker to compare readable results. Neither Base64 decoding nor text formatting validates an API token or authorizes a request.

Understand image previews

Decode can preview PNG, JPEG, GIF, and WebP when their initial byte signatures match a supported format. For a data URL, its declared type must agree with the detected format, or be application/octet-stream. Raw Base64 can also be recognized without a header.

Signature detection is a preview hint, not a complete file check. If the browser cannot display the image, a message replaces the broken preview and the byte download remains available. SVG, HTML, and other document formats receive no rendered preview. A decoded file can still contain untrusted data.

Copy, download, swap, and reset

Action Behavior
Copy Copies the encoded output in Encode, or valid nonempty UTF-8 text in Decode
Download encoded text Saves the displayed Base64 or data URL as base64-encoded.txt
Download decoded file Saves the original decoded bytes, including a UTF-8 BOM
Swap Moves a nonempty text result into the opposite mode; unavailable for non-UTF-8 bytes
Reset Clears text and file data and restores Encode, Standard Base64, padding, and the default file-output choice
Share Shares the tool page link; it does not attach the input or result

Decoded filenames are generated by the tool, not recovered from the source. Recognized raster images receive a matching extension; other UTF-8 results use .txt, and other bytes use .bin. Downloads are sent as attachment bytes, not rendered as the declared media type. A valid empty data URL can produce a zero-byte download even though Copy and Swap have no text to use.

While a file is being read, or when conversion fails, older results are unavailable and Copy, Download, and Swap are disabled. Reset, a new file, text editing, or a mode change cancels the effect of an older pending read.

Size limits and common decoding errors

Files, UTF-8 source bytes, and decoded bytes are limited to 5 MiB. Decode input is limited to 7,340,032 characters, including its header and whitespace; data URL headers are limited to 1,024 characters before the comma. Browser memory still holds input and output together, so use normal uploads for large assets.

Padded Standard Base64 uses 4 × ceil(byte count / 3) output characters before any data URL header. Three bytes become four characters. The approximate one-third increase describes longer inputs; short inputs have larger proportional padding overhead, and Unicode characters can occupy multiple UTF-8 bytes.

If decoding fails, check the selected alphabet, missing or extra characters, quotes copied around the string, an unsupported data URL header, and padding placement. The tool does not turn URL percent-encoded input into Base64 first. Use the URL Encoder / Decoder for that separate format. See URL Encoding vs Base64 for protocol examples.

Privacy and processing

The converter uses tab memory and does not upload inputs or save them in local storage. Its analytics event payloads include action, mode, or alphabet information, without text, filenames, media types, or file contents. Input and result regions are marked for Clarity masking; site analytics follow the site's consent settings.

Copy puts text on your clipboard, which may have history or sync. Downloaded files persist separately. Reset clears the tool's current state; it does not erase those other copies. Local conversion and reversible encoding are different claims: Base64 itself supplies no confidentiality.

Sources

Frequently asked questions

Choose a mode and the required alphabet, then enter text, select a file in Encode, or paste an encoded value in Decode. Copy uses a nonempty text result; decoded downloads preserve the original bytes.

Yes. Select Base64url for the - and _ alphabet. Encoding defaults to no padding for that choice, with an optional padding checkbox. Match the receiving protocol; a complete JWT belongs in JWT Decoder.

Base64 represents arbitrary bytes. If those bytes are not valid UTF-8, the tool disables text copy and swap instead of substituting replacement characters. Download decoded file preserves the bytes exactly.

Yes. Encode files up to 5 MiB as Base64 only or a Base64 data URL. Decode accepts Base64 data URLs with supported simple headers, including charset=utf-8. Their payload uses the standard alphabet, and the text view attempts UTF-8 only.

Yes, for valid Unicode text encoded as UTF-8. The text view also preserves a UTF-8 BOM. Malformed Unicode surrogates and invalid UTF-8 bytes are not silently replaced.

Decode can preview PNG, JPEG, GIF, and WebP using initial byte signatures and compatible declared types. A preview is not file validation. SVG and HTML appear only as text; a failed image display does not prevent a byte download.

Files, UTF-8 source bytes, and decoded bytes are limited to 5 MiB (5,242,880 bytes). Decode input is limited to 7,340,032 characters and data URL headers to 1,024 characters before the comma. Base64 adds size and browser memory use.

The converter processes inputs in tab memory without uploading them or saving them in local storage. Its analytics payloads omit text, file contents, filenames, and media types. Clipboard and downloads keep their own copies; Reset does not erase those.
7 min read