I recently received a request to convert PDF files to Base64 using Power Automate. The requirement is that when a user uploads a PDF file to a SharePoint Document library, that specific PDF should be converted into Base64 format and stored as a text file in the same library.
This Power Automate Tutorial will show you how to convert PDF to Base64 using Power Automate.
Convert PDF to Base64 Using Power Automate
Before creating flow, ensure you have a SharePoint Document Library like the screenshot below.

To convert the PDF file to Base64 using Power Automate, follow the steps below:
1. Create an automated cloud flow. Give the flow name and select the trigger ‘When a file is created (properties only).’ Click on Create.

2. Now, Provide the mandatory fields, such as Site Address and Library Name.

3. Next, we will add another action, Get file content, which retrieves the contents of a file using its identifier.
To do this, click the + icon to add Get file content. After that, select the SharePoint Site address and set the File identifier as Identifier (Select the value from dynamic content).

4. Next, add a condition action to check whether the uploaded file is a PDF or not.
To do this, click the + icon to add a Condition. Set the properties such as File name with extension contains .pdf / File name with extension ends with .pdf, as in the screenshot below.

5. Click the + icon to add the Compose action inside the True section. Inside the input box, click the fx button to enter the expression below.
base64(body('Get_file_content')['$content'])This base64 function converts PDF to base64. Then click the Add button.

6. After converting PDF to base64, add an action to store text files in a SharePoint library.
To do this, click the + icon to add the Create file (Under SharePoint connector). Provide the values to the mandatory properties such as Site Address, Folder Path, File Name, and File Content.
The file name must include the .txt extension, and the file content uses the dynamic content from the Compose action, ‘Output.’

Let’s save the flow and test it to see how it works. Click on Save > Test > Manually > Run flow.
For testing purposes, I uploaded a PDF file to the document library, and then after some time, you can see a text file will be added to the same library as shown below.

I hope this article helped you to know how to convert PDF to base64 using Power Automate.
Also, you may like some more Power Automate articles:
- Convert Base64 to an Image File in Power Automate
- Remove Top Few Lines of an Excel File Using Power Automate
- convert word to pdf using Power Automate
- Convert String to Date using Power Automate
- Convert HTML to PDF in Power Automate
- Create an Instant Cloud Flow in Power Automate

After working for more than 18 years in Microsoft technologies like SharePoint, Microsoft 365, and Power Platform (Power Apps, Power Automate, and Power BI), I thought will share my SharePoint expertise knowledge with the world. Our audiences are from the United States, Canada, the United Kingdom, Australia, New Zealand, etc. For my expertise knowledge and SharePoint tutorials, Microsoft has been awarded a Microsoft SharePoint MVP (12 times). I have also worked in companies like HP, TCS, KPIT, etc.