Base64 Encoder & Decoder

Convert text or a file to Base64, or decode Base64 back to text or a file. Both the standard alphabet and the URL-safe Base64URL alphabet are supported, with optional padding and line breaks. Text is handled as UTF-8, so accents, Arabic and emoji work. Everything happens in your browser and nothing is uploaded.

Processed locally in your browser. Your data is not uploaded to our servers.

Direction

Your text stays in this page: it is never uploaded or sent to analytics.

The file is read in your browser and never uploaded. Up to 50 MB.

SettingsDefault settings

Result

    The result appears here.

    Examples

    Reference values you can check against any other Base64 tool:

    InputStandardURL-safe, no padding
    fZg==Zg
    foobarZm9vYmFyZm9vYmFy
    €4oKs4oKs
    😀8J+YgA==8J-YgA
    0xFB 0xFF 0xFE+//+-__-

    Formula & Methodology

    Base64 turns every 3 bytes (24 bits) into 4 characters of 6 bits each, taken from a 64-character alphabet. When the input is not a multiple of 3 bytes, = signs pad the end to a multiple of 4 characters. The output is about one third larger than the input. Text is converted to UTF-8 bytes first.

    encoded length = ⌈n ÷ 3⌉ × 4
    FeatureStandard (RFC 4648 §4)Base64URL (RFC 4648)
    Characters 62 and 63+ and /- and _
    PaddingNormally kept as =Usually left out
    Typical useEmail, data: URIs, filesURLs, file names, JWT

    Base64 is an encoding, not encryption: anyone can decode it, so never use it to hide secrets.

    Notes and limitations

    • Decoded bytes must be valid UTF-8 to be shown as text. Other data, such as images, is offered as a file download instead.
    • Decoding is strict about characters, length and padding, so typos are reported with the position of the first invalid character instead of being silently skipped.
    • Padding that is missing is accepted when the length makes the meaning clear; wrong or misplaced padding is an error.
    • Files and text up to 50 MB are accepted. Large inputs depend on your device’s memory and may take a moment.
    • This tool does not guess character sets other than UTF-8, and it does not encrypt or sign anything.

    How to Use

    1. Choose Encode to Base64 or Decode from Base64.
    2. Type or paste your text. To encode a file, choose it with the file picker instead.
    3. Pick the alphabet: standard, or URL-safe Base64URL (padding is switched off for you). When decoding you can leave it on automatic detection.
    4. Read the result and its size. If the input is invalid, the message points to the first problem.
    5. Copy the result or download it as a file.

    Frequently Asked Questions

    What is the difference between Base64 and Base64URL?

    Both use the same idea, but Base64URL replaces + and / with - and _ so the text is safe inside URLs and file names, and it usually leaves out the = padding. JSON Web Tokens use Base64URL. Choose the alphabet that the other system expects.

    Is Base64 encryption?

    No. Base64 only changes how data is written. Anyone can decode it instantly, so do not use it to protect passwords or other secrets.

    Are my text and files uploaded?

    No. Encoding and decoding run in your browser and the text or file never leaves your device. Nothing you enter is sent to ToolQuarter, analytics or any other service.

    Why does decoding show “not valid UTF-8”?

    Base64 can hold any bytes, not only text. If the decoded bytes are an image, a PDF or another binary file, they are not readable as text, so the tool offers a download and shows the first bytes in hexadecimal instead.

    Do accents, Arabic and emoji work?

    Yes. Text is converted to UTF-8 before encoding and read back as UTF-8 when decoding, so characters in any language round-trip correctly. The browser’s plain btoa function cannot do this.

    Last updated: