Base64 Encoder & Decoder
Encode text or a local file to Base64, or decode Base64 back to readable text or the original bytes. Base64 (RFC 4648) writes any bytes using 64 safe characters — A–Z, a–z, 0–9, + and / — so binary data can travel through text-only places such as JSON, email or URLs. Text is converted to UTF-8 first, so Arabic, Chinese, accented letters and emoji work, and everything happens in your browser.
- Free to use
- No account required
- Converted in your browser
Base64 Encoder & Decoder
Was this tool helpful?
Good to know
- Useful for
- Embedding small files or binary data in JSON, HTML or configuration, reading Base64 values from APIs and logs, building URL-safe tokens, and checking whether a Base64 string is valid.
- Accepts
- Text up to 1 MiB as UTF-8, a file up to 5 MiB, or Base64 text that decodes to at most 5 MiB
- Produces
- Base64 or Base64URL text (padded or unpadded), or the decoded UTF-8 text and bytes, with a preview of the first 4,096 characters on the page
Privacy
Text and files are encoded and decoded in your browser. They aren't uploaded, logged, sent to analytics or an AI service, or saved in browser storage, cookies or the page address, and everything disappears when you reload the page.
Limitations
- Base64 is an encoding, not encryption: anyone can decode it, and it makes data about a third larger.
- Decoding is strict. Spaces and line breaks (including 76-character MIME line wrapping), data: URL prefixes, mixed alphabets, wrong padding and non-zero leftover bits are reported as errors rather than skipped or repaired.
- Decoded bytes are shown as text only when they're valid UTF-8 without control characters; anything else is treated as binary data and offered as a download, never displayed, opened or run.
- Text is encoded as UTF-8 only. Other character encodings (such as UTF-16 or Windows-1252) aren't offered, and text containing an unpaired surrogate (half of an emoji) is rejected.
- The page shows at most the first 4,096 characters of a result; Copy and Download always use the full result.
Tips
- Use Base64URL for values that go into URLs, file names or JSON Web Tokens; it usually leaves out the = padding.
- Need to check a decoded JSON payload? Paste it into the JSON Formatter (/text/json-formatter).
- Need unique IDs rather than encoded data? Use the UUID Generator (/text/uuid-generator).
How to encode or decode Base64
- Choose Encode or Decode.
- Pick Standard Base64 (+ /) or URL-safe Base64URL (- _); when encoding, choose whether to add = padding.
- To encode, type or paste text, or switch to Local file and choose a file. To decode, paste the Base64 text.
- Press Encode, Encode file or Decode.
- Copy the result or download it: Base64 as a .txt file, decoded text as .txt, or the decoded bytes as a .bin file.
Frequently asked questions
What is Base64 encoding?
Base64 is a way of writing any bytes — text, images or other files — using only 64 printable characters: A–Z, a–z, 0–9, + and /, plus = for padding. Every 3 bytes become 4 characters, so the result is about a third larger. It's defined in RFC 4648 and is used to carry binary data through text-only formats such as JSON, email and data URLs.
How do I encode text to Base64?
Choose Encode, type or paste your text and press Encode. The text is first converted to UTF-8 bytes, which are then encoded, so for example foobar becomes Zm9vYmFy. Choose Standard or URL-safe Base64 and whether to add = padding, then copy the result or download it as a .txt file.
How do I decode Base64 into readable text?
Choose Decode, paste the Base64 and press Decode; Zm9vYmFy becomes foobar. The input must be one complete Base64 string without spaces or line breaks; padded and unpadded input both work. If the bytes are valid UTF-8 text they're shown and can be copied. Otherwise they're treated as binary data, which you can download as a .bin file but which isn't shown as text.
What is the difference between Base64 and Base64URL?
They use the same method but differ in two characters. Standard Base64 uses + and /, which have special meanings in URLs and file names. Base64URL (RFC 4648 section 5) uses - and _ instead, and the = padding is usually left out. Choose the alphabet that matches the system you're working with; mixing the two in one string is reported as an error.
Can I encode Arabic, Chinese and emoji?
Yes. Text is converted to UTF-8 bytes before encoding, so any Unicode text works, including Arabic and other right-to-left scripts, Chinese, Japanese, accented letters and emoji. Decoding gives back exactly the same characters, without changing their normalization. Text containing a broken emoji (an unpaired surrogate) is rejected instead of being silently altered.
What does Base64 padding (=) mean?
Base64 works in groups of 3 bytes. When the data doesn't divide evenly, the last group is shorter, and one or two = characters can be added so the text length is a multiple of 4. Padding is optional in many systems, and this tool accepts both padded and unpadded input. Padding may only appear at the very end, and only as many = as the length requires.
Can I convert files to Base64?
Yes. Choose Encode, then Local file, pick a file of up to 5 MiB and press Encode file. The file is read on your device and its exact bytes are encoded; you can copy the full Base64 or download it as a .txt file. No data: prefix or MIME type is added. To turn Base64 back into a file, decode it and download the bytes.
Is Base64 encryption, and is my data uploaded?
No to both. Base64 isn't encryption and doesn't hide anything: anyone can decode it, so don't use it to protect passwords or private data. This tool runs entirely in your browser — your text, files and results aren't uploaded, logged, sent to analytics or saved in browser storage, cookies or the page address, and reloading the page clears them.
Related text and writing tools
Related guides
- 8 min readBase64 Is Not Encryption: How to Encode, Decode and Check Base64Base64 turns bytes into 64 safe characters, about a third bigger, and anyone can decode it. See tested UTF-8 and file examples, and why decoding fails with line breaks, data: or padding.
- 8 min readHow to Fix "Invalid JSON" ErrorsFind the mistake from a JSON error's line and column, then fix trailing commas, single or curly quotes, comments, NaN, leading zeros, a BOM or a missing brace.
- 8 min readUUID v4 vs. v7: Which Should You Use?Use UUID v7 for database keys that should sort by creation time and v4 when an ID mustn't reveal when it was made. Neither is a secret. Tested with 20 of each.

