Base64 Encoder & Decoder
Encode text and files to Base64 or decode Base64 back into readable data. Supports standard and URL-safe Base64, Data URLs, and file download — all in your browser.
Read the guide: How to Use Base64 Encoding and DecodingText to Encode
Base64 Result
Your data is processed locally where possible and is not included in analytics.
How the Base64 Encoder & Decoder works
- Text is encoded as UTF-8 bytes, then those bytes are represented as Base64 characters using the browser's built-in TextEncoder and btoa.
- Files are read as an ArrayBuffer and encoded byte-by-byte to Base64, with an optional Data URL that includes the file's MIME type.
- Decoding validates the Base64 alphabet and padding before converting back to bytes. Text decode interprets the bytes as UTF-8; file decode offers a download with the correct extension.
- Data URLs are parsed to extract the MIME type and Base64 data automatically, so you can paste a data:image/png;base64,... URL and download the file directly.
See also: JSON Validator, JSON Minifier, XML Formatter and YAML Formatter.
Examples
Encode text
Hello World → SGVsbG8gV29ybGQ=
Decode Base64
SGVsbG8gV29ybGQ= → Hello World
Unicode text
Hello 👋 → SGVsbG8g8J+Riw==
Useful tips
- Use Standard Base64 for general purposes and Base64URL for URLs, filenames or JWT tokens.
- If decoding produces garbled text, the data may be binary — switch to File Decode mode to download it as a file.
- Paste a Data URL (data:...;base64,...) in File Decode mode to automatically detect the MIME type and download the file.
- Base64 increases data size by roughly 33% — consider compression if you need to reduce the output size.
Frequently asked questions
What is Base64?+
Base64 is an encoding scheme that represents binary data using 64 ASCII characters (A-Z, a-z, 0-9, + and /). It is used to safely transport binary data through text-based systems.
How do I encode text to Base64?+
Choose the Encode mode, paste your text into the input editor, and click Encode to Base64. The Base64 output can be copied or downloaded.
How do I decode Base64?+
Choose the Decode mode, paste your Base64 string into the input editor, and click Decode Base64. If the decoded data is valid UTF-8 text, it is displayed in the output editor.
Is Base64 encryption?+
No. Base64 is encoding, not encryption. Anyone with the Base64 string can decode it instantly without a key. Do not use Base64 to protect sensitive information.
Can Base64 encode files?+
Yes. Choose File Encode mode, upload a file (up to 10 MB), and click Encode File. The Base64 representation is generated, with an optional Data URL for inline use.
Can I decode a Base64 file?+
Yes. Choose File Decode mode, paste a Base64 string or Data URL, and click Decode to File. The decoded bytes can be downloaded with the appropriate file extension.
What is Base64URL?+
Base64URL is a URL-safe variant of Base64 that replaces + with - and / with _, so the result can be used in URLs and filenames without escaping. Padding is often omitted. Base64URL is not identical to standard Base64.
Why does Base64 make data larger?+
Base64 represents every 3 bytes of input as 4 characters, so the encoded output is approximately 33% larger than the original data. This overhead is the trade-off for safe text-based transport.
Can Base64 contain images?+
Yes. Any binary data, including images, can be encoded as Base64. The File Encode mode generates a Base64 string and an optional Data URL (data:image/png;base64,...) that can be embedded directly in HTML or CSS.
What is a Base64 Data URL?+
A Data URL is a URL that embeds the file data directly in the URL string, prefixed with the MIME type. For example, data:image/png;base64,iVBORw0KGgo... embeds a PNG image. Data URLs can be used in HTML, CSS and JSON where inline binary data is needed.
Is Base64 secure?+
No. Base64 is encoding, not encryption. It provides no confidentiality — anyone with the Base64 data can decode it. If you need security, use encryption (such as AES) and manage keys appropriately.
Is my Base64 data stored when I use this tool?+
No. All encoding and decoding runs entirely in your browser. Your text, files and Base64 strings are never uploaded or stored, and your data is not included in analytics.
Related guides
How to format and validate JSON
JSON is the lingua franca of the modern web, but a single stray comma can break an entire API response. This guide shows you how to format and validate JSON quickly, what the most common errors look like, and how to fix them — all using a free tool that runs entirely in your browser.
How to convert JSON to CSV
JSON is great for APIs, but spreadsheets still rule for analysis. This guide explains how to turn JSON into a clean CSV file, how nested values are handled, and the common pitfalls to avoid — all using a free tool that runs entirely in your browser.
How to validate JSON
A single stray comma can break an entire API response. This guide explains what JSON validation is, the most common syntax errors and how to fix them — all using a free tool that runs entirely in your browser.
How to minify JSON
Minified JSON is smaller, faster to transfer and just as valid as the formatted original. This guide explains what minification does, how it differs from compression, and why your data stays exactly the same — all using a free tool that runs entirely in your browser.
What would you like to do next?
JSON Validator
Validate JSON online, find syntax errors, format and minify JSON with clear error messages and line and column information.
JSON Minifier
Minify JSON online by removing unnecessary whitespace while preserving your data. Validate, compress, copy and download compact JSON.
XML Formatter
Format and beautify XML online with proper indentation and readable structure. Validate, format, minify, copy and download XML.
YAML Formatter
Format and beautify YAML online with consistent indentation and readable structure. Validate, format, convert to JSON, copy and download YAML.