Basic Text Conversion
- Enter or paste your text in the input textarea.
- Choose your preferred mode:
- Auto Detect automatically determines if the input is Base64 encoded.
- Encode forces Base64 encoding of the input.
- Decode forces Base64 decoding of the input.
- Select your character encoding:
- UTF-8, the default and recommended option for most uses
- ASCII
- ISO-8859-1
- UCS-2
- View the result below the input area. Decoded image Data URIs appear as an image preview; text remains in the output area.
- Click Copy Result to copy text output, Download to save the result, or Swap to exchange the panels and toggle the conversion direction.
Encode/Decode File Content
- Click Upload File to select any file, including text, image, PDF, or other binary data.
- The file upload status appears in the input area and the converted data appears in the output area.
- Conversion happens automatically based on your selected mode and encoding.
Preview Images and Swap Values
To preview an image, provide a valid Data URI with an explicit image/* MIME type, such as data:image/png;base64,..., and use Auto Detect or Decode mode. The converter uses the declared MIME type only; it does not infer image formats from magic bytes. The text output and Copy control are hidden during the preview, while Download remains available. If the browser cannot load the image, a binary placeholder is shown instead.
Swap exchanges the full Input and Output values and toggles Encode/Decode. In Auto Detect mode, it chooses the opposite of the last successful conversion. Swap is disabled for empty, invalid, binary, or image output.
URL Parameter Integration
The tool supports external linking, allowing you to create URLs that automatically load data into the converter.
Creating Shareable Links:
https://tools.codesamplez.com/base64-converter/?data=YOUR_BASE64_OR_TEXT_DATA
Examples:
?data=Hello%20World for encode mode input?data=SGVsbG8gV29ybGQ%3D for decode mode input
How It Works:
- Add
?data= followed by URL-encoded text or Base64 data. - The tool automatically decodes the URL parameter, pre-populates the input, sets Auto Detect mode, and immediately performs the conversion.
- The conversion starts as soon as the page loads.
URL Encoding Requirements:
- Spaces become
%20 - Plus signs become
%2B - Equal signs become
%3D - Ampersands become
%26