Encoding a short string
The 5-byte text "Hello" becomes 8 Base64 characters, including one padding character.
Hello -> SGVsbG8=Encode text or a file to Base64, or decode Base64 and a data URL back into readable text or a downloadable file.
Fill in the values, paste your text, or upload the file this tool works with.
Most tools update live as you type; a few use a single button. Either way, the result appears right on this page.
Copy, download, or share what the tool produces — you're always in control of the output.
The Base64 Encoder/Decoder converts text or a file into Base64, or decodes Base64 text and data URLs back into readable content or a downloadable file — entirely inside your browser.
Switch between Text and File mode above to encode or decode Base64 right on this page — paste a string or drop a file, then copy the result or download it as a file.
Base64 turns bytes into plain ASCII text using a 64-character alphabet: A–Z, a–z, 0–9, plus + and /. Every group of 3 input bytes (24 bits) becomes 4 output characters (4 × 6 bits), which is why encoded output is always about a third larger than the original.
When the input length isn't a multiple of 3, one or two = characters are added at the end as padding, so a decoder knows exactly where the real data stops.
The 5-byte text "Hello" becomes 8 Base64 characters, including one padding character.
Hello -> SGVsbG8=Text mode encodes or decodes a string directly — paste plain text to get its Base64, or paste Base64 to recover the original text. It's the fastest way to prepare a value for a JSON field, config file, or API payload.
File mode reads an uploaded file and produces a complete data URL (data:<mime-type>;base64,<data>), with the MIME type detected automatically. Decoding a data URL or a raw Base64 string in file mode turns it back into a downloadable file with its original bytes intact.
Base64 is an encoding, not a cipher — it has no secret key. Anyone who sees the encoded text can decode it back to the original content in a single step, so it never hides or protects sensitive data such as passwords or personal information.
All Base64 text and file conversion happens locally in your browser. Nothing you type or upload is sent to a server.
Base64 is commonly used to embed images or fonts directly in CSS or HTML with a data: URI, to send binary data through JSON or XML APIs that only accept text, to store binary values in environment variables or config files, and to encode email attachments and HTTP Basic Authentication headers.
No. Base64 only changes how bytes are represented as text; it provides no confidentiality and uses no key. Anyone can decode it back to the original content, so it should never be used to protect passwords or sensitive data.
The = characters are padding. Base64 encodes input in groups of 3 bytes at a time; when the total length isn't a multiple of 3, one or two = characters are added at the end so a decoder knows exactly where the real data stops. A string with no padding decoded into exact groups of 3 bytes.
The pasted text is either not valid Base64 (wrong characters or padding) or it decodes to bytes that are not valid UTF-8 text. File mode still works from the same input, since it decodes to raw bytes rather than text.
Yes, by roughly a third. Base64 represents each 3 bytes of the original file with 4 text characters, so a 300 KB file becomes about 400 KB once encoded.
It works well for typical images and documents, but very large files can be slower to encode or decode as text in the browser, since the whole file is held in memory during conversion.
Generate standards-compliant UUID v4 and GUID identifiers individually or in bulk.
Format, minify, and validate JSON and XML, and convert between JSON and YAML.
Create QR codes and read QR images locally.
Encode and decode URLs in separate tabs, with batch and recursive options.
Convert Unix timestamps (seconds and milliseconds) to dates and vice versa.
Encode and decode HTML entities safely.
Test regular expressions and preview replacements.
Decode JWT header and payload locally.
Build, validate, and decode 5-field cron expressions with next run times.
Compare two JSON values and list changed paths.