To convert an image to Base64 in Power Automate, encode the file locally as a standard RFC 4648 string and paste the resulting text into a Compose action, an initialized variable, or an expression—Power Automate treats Base64 as plain text and lets you reference it from any downstream step. Power Automate Desktop includes native actions for this conversion, but cloud flows do not, so when a SharePoint file, a form attachment, or an HTTP response carries a PNG, JPEG, GIF, or WebP, the workflow typically needs a clean Base64 payload built outside the platform and dropped into a variable. The fastest way to produce that string without writing code or uploading the image is to use a browser tool that decodes the bytes, validates the container, and emits either plain Base64 or a complete data URL with the correct MIME type. Once the text is copied, a Compose or Set Variable step holds it for the rest of the flow, and expressions like base64ToBinary(), concat(), or variables() can shape it for Outlook, Adaptive Cards, Dataverse, or external HTTP endpoints. The result is a workflow-friendly text value that travels through the run history, survives retries, and never depends on a CDN or a temporary URL.

Common Power Automate Scenarios That Need an Image Base64
Why does a Power Automate flow need a Base64 string at all? Most triggers and actions return either a file identifier (a SharePoint path, an attachment ID, a Dataverse row) or a binary blob, but downstream consumers often want the image as inline text. The cases that come up most often include:
- Embedding a logo, signature, or chart directly inside an Outlook email body so the message renders without external image requests
- Passing an image through an HTTP action to an API that accepts JSON or form-data with a Base64 field
- Storing small reference images inside Dataverse text fields, SharePoint list columns, or Excel Online tables
- Supplying Adaptive Card images via the url property, where a data URL removes the need for a public CDN
- Building JSON fixtures and mocks that Power Automate can replay deterministically during testing
- Sending file content to a service that prefers text transport over multipart upload overhead
Each case has the same underlying need: a clean RFC 4648 Base64 string that carries the exact bytes of the original image, paired with the MIME type the bytes actually represent. Power Automate does not derive that string by itself, which is exactly the gap a dedicated local encoder fills.
Generate a Valid Base64 String for Power Automate
The exact way to convert an image to Base64 in Power Automate depends on where the image starts and where the Base64 is consumed. Cloud flows and desktop flows take different routes, so it helps to split the task into a one-time local encoding step and a series of Power Automate steps that move the string through the run.
For cloud flows whose image file lives outside the platform:
- Open the Image to Base64 Converter in any modern browser tab and load a single PNG, JPEG, GIF, or WebP file.
- Pick plain Base64 when a downstream step wants the encoded characters only, or pick data URL when the consumer expects the full data:image/...;base64,... prefix ready to paste into HTML or an Adaptive Card.
- Click Convert and confirm the preview shows the expected image at its real decoded pixel dimensions.
- Copy the full output text to the clipboard.
- In the Power Automate designer, add a Compose action (or Initialize Variable) named, for example, ImageBase64, and paste the text as the input.
- Reference the value from any later step using the dynamic content picker or variables('ImageBase64') inside an expression.
For Power Automate Desktop flows, the same string still works, but you can usually skip the browser step entirely. Use the Get files from folder action or trigger the flow with a file input, drop the file into a binary variable with the Read file from disk action, apply the Encode to Base64 string action from the Cryptography group on that variable, and store the result in a text variable that a subflow, a webhook, or a clipboard action can consume.
When the image already lives inside the flow as a file content blob—for example, the body of a SharePoint Get file content action—Power Automate returns binary rather than Base64. Wrap that binary with the base64() expression to obtain an inline string without leaving the designer:
- base64(triggerBody()?['file']) when the file is on the trigger payload
- base64(body('Get_attachment')?['contentBytes']) when the file came in as an attachment
- base64ToBinary(...) when the downstream action expects the original bytes back
- base64ToString(...) when you only need to inspect the text after the encoding
These expressions confirm that the flow treats the Base64 text as the canonical transport form for image data, which is why a clean, well-formed string copied from a local encoder drops in without further transformation.
Encode the Image File Locally With the Browser Tool
Encoding an image with the Image to Base64 Converter is a short, repeatable process that runs entirely on the device. The browser reads the file, validates the byte container, decodes it for a real preview, and only then emits the encoded string.
- Open the Image to Base64 Converter page and choose a single PNG, JPEG, GIF, or WebP file from the device.
- Pick the output mode: plain Base64 when a downstream step only wants the encoded characters, or image data URL when the consumer expects the full data:image/...;base64,... prefix.
- Click Convert. The tool checks the file size, validates the structural container (PNG signature plus IHDR plus IEND, JPEG SOI plus EOI, GIF header plus trailer, or WebP RIFF plus WEBP plus a bounded first chunk), and then decodes the image through the browser's image decoder.
- Confirm the detected byte format, the real decoded pixel dimensions, the file size, and the preview thumbnail. The thumbnail is only a layout constraint; the encoded payload preserves the original bytes exactly.
- Copy the complete output. The encoding follows the RFC 4648 Base-N alphabet of uppercase and lowercase letters, digits, plus, and slash, with one or two terminal equals signs when the last group has fewer than three bytes. The copy action is generation-guarded, so a later conversion cannot overwrite a successful clipboard write with stale data.
The input limit is exactly 5 MiB (5,242,880 bytes); a file one byte beyond that is rejected before its body is read, and the actual ArrayBuffer length is checked again afterwards. The maximum Base64 string length for that byte budget is 6,990,508 characters, and the longest supported data URL fits in 6,990,531 characters—any overshoot returns an explicit error and no partial string. Decoded images must also fit inside 20,000 pixels per edge and 40,000,000 pixels of total area, because a small compressed file can balloon dramatically once it is decoded into raw pixel memory.
Paste the Encoded String Into Power Automate
Once the string is on the clipboard, paste it into the Power Automate step that needs it. The exact placement depends on what the downstream action expects:
- Compose or Initialize Variable: paste the Base64 text into the Inputs box. Power Automate stores it as a string and you can reference it with the dynamic content picker or with variables('ImageBase64') inside an expression.
- Outlook Send Email (V2) HTML body: build an img tag inline, for example <img src="data:image/png;base64,@{variables('ImageBase64')}" />, and the message renders the image without any public CDN.
- HTTP action body: paste the plain Base64 into a JSON property such as "imageBase64": "@{variables('ImageBase64')}" and set the request header Content-Type to application/json. Some APIs prefer the data URL prefix; others prefer plain text—match what the endpoint documents.
- Adaptive Card: set the image url property to the full data URL, including the prefix. Adaptive Cards render the embedded image directly, which removes the need to host the file in SharePoint or any other location.
- Dataverse or SharePoint list text column: paste the plain Base64 string into the column. Text columns are ideal for small reference icons, signatures, and thumbnail-sized images that fit comfortably under a few hundred kilobytes.
If the flow receives Base64 text from another system and needs to rebuild the image, the reverse workflow is described in how to convert Base64 back to an image inside Power Automate. Inside the designer, wrap any pasted value with base64() or base64ToBinary() when the source is binary, and use string functions like concat() or replace() when the target needs the data URL prefix stripped or appended. Power Automate evaluates these expressions synchronously, so the encoded string moves through multiple steps without a temporary file or an external service.
Supported Formats, Hard Limits, and Common Pitfalls
The Image to Base64 Converter supports exactly four byte containers. Anything else—including SVG, AVIF, HEIC, BMP, TIFF, PDF, and arbitrary text—is outside scope even if the browser or the file extension calls it an image. Encode those containers with a different converter first, then run the result through this tool only if the output is already PNG, JPEG, GIF, or WebP.
| Format | Detected from bytes | Data URL MIME |
|---|---|---|
| PNG | 8-byte signature, valid IHDR chunk, terminal IEND | image/png |
| JPEG | SOI marker, following marker, terminal EOI | image/jpeg |
| GIF | GIF87a or GIF89a header, logical screen descriptor, trailer | image/gif |
| WebP | RIFF length matches file size, WEBP FourCC, bounded VP8, VP8L, or VP8X first chunk | image/webp |
The MIME in data URL mode is taken from the verified byte container, never from the filename or the OS-declared MIME. A PNG renamed photo.jpg still produces data:image/png;base64,..., which is exactly what Power Automate and strict image consumers want. Limits and trade-offs to keep in mind:
- The hard input cap is 5 MiB (5,242,880 bytes). One byte beyond is rejected before reading, and the actual ArrayBuffer length is checked again afterwards.
- The maximum Base64 length for that input is 6,990,508 characters, and the longest data URL brings the total to 6,990,531 characters. Anything beyond returns an explicit error and no partial string.
- Decoded dimensions are bounded by 20,000 pixels per edge and 40,000,000 pixels of total area. A corrupted or oversized image is rejected rather than producing a misleading result.
- Base64 inflates transport size by roughly one third before any data URL prefix. For ordinary website delivery, host the image file and reference it normally; reserve Base64 for cases where a text representation is genuinely required, such as API payloads, JSON fixtures, email templates, offline prototypes, test data, and debugging flows.
- Conversion preserves the original bytes. The tool does not draw to canvas, resize, recompress, recolor, flatten transparency, select a GIF frame, remove metadata, or repair damage. Animated GIF and WebP bytes stay animated in the Base64 payload as long as the downstream consumer supports animation.
For smaller output before encoding, run the original image through the Image Compressor. For new pixel dimensions, run it through the Image Resizer first. Doing these tasks separately keeps the Base64 encoding predictable, because the string is a literal representation of the bytes the converter sees.