FormatFlow

No tool matches “”

Try a format (“webp”, “mp3”) or a verb (“merge”, “compress”).

Loading index

↵to open

Developer Tools · Updated October 17, 2026

Base64 Encoder & Decoder

You can encode text to Base64 or decode Base64 back to text in your browser, with UTF-8 support for accents, Chinese and emoji, optional line wrapping and file-to-Base64 for small files.

Runs in your browserFree · No sign-up · No watermark
TXTBase64Base64Runs in your browser
Loading the tool…

Everything runs locally in this tab. No file is uploaded while the tool loads.

This tool runs in your tab. Nothing is uploaded and no copy is stored.

How files are handled

At a glance

Formats
TXT, Base64 → Base64
Processing
In your browser
Max size
1 MB per file
Price
Free, no account
Updated
October 17, 2026
All Developer Tools

About Base64 Encoder

Base64 turns bytes into a safe ASCII string so they can travel through email, JSON, URLs and data URIs. The catch is that JavaScript's built-in btoa and atob only handle Latin-1, so the same functions destroy accents, Chinese characters and emoji unless the text is converted to UTF-8 bytes first. This encoder does that conversion for you in both directions.

The tool also encodes small files straight from your device, up to 1 MB, which is enough for a favicon, a small SVG or a test payload inside a data URI. Optional line wrapping at 64 or 76 characters keeps output readable in code and matches the line lengths traditionally used by MIME and PEM formats.

What this tool does

The details that matter when you use Base64 Encoder for real work.
  • UTF-8 safe both ways

    Text passes through TextEncoder and TextDecoder, so accents, Chinese, Japanese and emoji round-trip without being corrupted.

  • Encode or decode in one action

    Switch direction with the segmented control, run the conversion, and swap the result back to the input pane when you need to reverse it.

  • Optional line wrapping

    Wrap encoded output at 64 or 76 characters for readable code and mail headers, or leave it on one line for data URIs and API fields.

  • Small files to Base64

    Drop a file of up to 1 MB to encode its raw bytes, with the original size and the encoded length both shown.

  • Forgiving decoder

    Spaces and line breaks are ignored when decoding, and URL-safe Base64 characters are accepted and normalized before the conversion.

  • Copy with confirmation

    A dedicated copy button writes the output to the clipboard and shows a copied state so you know it worked.

How to use Base64 Encoder

No account, no installation — the whole job happens in this browser tab.
  1. 01

    Choose a direction

    Select Encode to turn text into Base64, or Decode to turn a Base64 string back into readable text.

  2. 02

    Enter your input

    Type or paste into the input pane. For decoding, the Base64 string can contain line breaks and missing padding.

  3. 03

    Set line wrapping if you need it

    Leave wrapping off for a single-line string, or choose 64 or 76 characters to match mail and PEM conventions.

  4. 04

    Run the conversion

    Press Encode or Decode and the result appears in the output pane, with character counts for both sides.

  5. 05

    Encode a file instead

    Drop a file of up to 1 MB into the file area to encode its raw bytes without converting it to text first.

  6. 06

    Copy or swap the result

    Use Copy to take the output, or Swap to move it into the input pane and reverse the direction in one click.

Supported formats and limits

Input
TXTBase64
Output
Base64
Processing
Client-side, in your browser. Nothing is uploaded.
Maximum size
1 MB per file
Requirements
Chrome, Edge, Firefox or Safari · 1 MB maximum for file encoding

Limitations worth knowing

  • File-to-Base64 is capped at 1 MB per file, and the encoded result is roughly a third larger than the source.
  • The output is plain Base64: no data URI prefix such as data:image/png;base64 is added, and nothing is encrypted.
  • Decoded output is only readable text for UTF-8 content; binary Base64 has to be saved as a file elsewhere to be useful.

Privacy and file handling

Encoding and decoding happen in your browser tab. Text and files are read by JavaScript on your device and never uploaded, stored or logged; closing the page clears the input and output panes.

Read the full privacy policy

Base64 Encoder FAQ

Short, direct answers to the questions people ask before using this tool.
Why can't I just use btoa and atob for Chinese text?
btoa throws when it sees characters above U+00FF, and atob returns Latin-1 text, so emoji and Chinese characters turn into mojibake. This tool converts to UTF-8 bytes before Base64 encoding and reverses that exact path when decoding.
Does Base64 encoding encrypt my data?
No. Base64 is a reversible encoding with no key, so anyone can decode it. Use it to move bytes through text-only systems, never to hide passwords, tokens or private data from someone who has the string.
Why is Base64 output about a third larger?
Every group of three bytes becomes four Base64 characters, so the encoded size is roughly 133 percent of the input. Line wrapping and padding characters add a few more characters on top of that.
What file types can I encode?
Any file up to 1 MB can be encoded, because the tool reads its raw bytes. Decoding back to text only makes sense for UTF-8 content; binary data will be reported as not valid UTF-8 instead of showing garbage characters.
Can I decode Base64 taken from a JWT or URL?
Yes, when the segment uses standard or URL-safe Base64. Spaces and line breaks are ignored, the URL-safe characters dash and underscore are converted, and missing padding is added before decoding.
Why does decoding fail with an error?
The usual causes are a truncated string, a character outside the Base64 alphabet, or bytes that are not UTF-8 text. The error names the offending character or explains that the decoded bytes are binary, so you can fix the paste or use a different tool.
Is my text or file uploaded?
No. Encoding and decoding run in your browser with JavaScript, and a selected file is read locally from your device. Nothing is sent to a server, stored or logged, and closing the page clears the input and output.
Can I encode a file larger than 1 MB?
Not with this tool. The 1 MB file cap keeps the browser responsive because Base64 expands the payload by roughly a third. For larger files, use the base64 command on the command line, which handles arbitrary sizes.

Background reading

Format guides that explain the trade-offs behind Base64 Encoder.