The simplest way to link to a PDF

To make a PDF into a link, you upload the PDF file to your web server and then create an HTML link that points to it. The reader clicks the link and the PDF opens in their browser or downloads, depending on their settings. This takes about three steps: upload the file, get its web address, and write the link code.

The HTML code looks like this: <a href="path-to-your-file.pdf">Click here to read the PDF</a>. Replace "path-to-your-file.pdf" with the actual location of your PDF on your server, and replace "Click here to read the PDF" with whatever text you want the reader to see.

Key Takeaways

  • Upload your PDF file to your web server using FTP, a file manager, or your hosting control panel.
  • The HTML link code is <a href="filename.pdf">Link text</a>, where you replace the filename and link text with your own.
  • Use a relative path (just the filename) if the PDF is in the same folder as your HTML page, or a full URL if it is in a different location.
  • You can force the PDF to download instead of opening in the browser by adding download to the link tag.

Uploading your PDF to your web server

Before you can link to a PDF, the file has to live somewhere on the internet. Most people store PDFs on the same web server that hosts their website. Log into your hosting account's control panel (usually cPanel, Plesk, or your host's custom dashboard) and look for a file manager or FTP access.

Use the file manager to navigate to the folder where your website files live — usually called public_html or www. Create a new folder called pdfs if you want to keep them organized, then upload your PDF file there. Write down the exact filename, including the .pdf extension, because you will need it in your link code.

If you are using FTP instead of a file manager, connect with an FTP client like FileZilla, navigate to the same folder, and drag your PDF file into it. The process is the same; you just use different software to do it.

Writing the link code for your PDF

Once the PDF is uploaded, you write a standard HTML link. If your PDF is in a folder called pdfs and the file is named guide.pdf, the code is:

<a href="pdfs/guide.pdf">Download our guide</a>

The text between the opening and closing tags — "Download our guide" in this example — is what the reader sees on the page. Make it clear that it is a PDF so people know what to expect. You can also add a file size if you want: <a href="pdfs/guide.pdf">Download our guide (2.5 MB)</a>.

If the PDF is in the same folder as your HTML page, you can skip the folder name and just write <a href="guide.pdf">Download our guide</a>. If the PDF is on a different website entirely, use the full web address: <a href="https://example.com/pdfs/guide.pdf">Download our guide</a>.

Making the PDF download instead of opening

By default, when someone clicks a PDF link, the file opens in their browser. If you want it to download to their computer instead, add the word download to your link tag:

<a href="pdfs/guide.pdf" download>Download our guide</a>

You can also specify what name the file should have when it downloads by adding an equals sign and the new name: <a href="pdfs/guide.pdf" download="my-guide.pdf">Download our guide</a>. This is useful if your actual filename is something like 2024-Q3-report-final-v2.pdf but you want it to save as quarterly-report.pdf.

Using a content management system instead of HTML

If you use WordPress, Wix, Squarespace, or another content management system, you usually do not write HTML by hand. Instead, you upload the PDF through the system's media library and insert a link using the visual editor.

In WordPress, click the + button in the editor, search for "file" or "document", and upload your PDF. The system generates the link code for you. Wix and Squarespace have similar buttons in their editors — look for "Link" or "Insert" and choose "File" or "Document". The process is simpler because the system handles the file path for you.

Checking that your link works

After you publish your page, click the link yourself to make sure it points to the right file. If you get a 404 error, the most common causes are a misspelled filename, the wrong folder path, or the PDF not actually being uploaded to the server.

Double-check the filename — capitalization matters, so Guide.pdf is different from guide.pdf. Verify that the folder path matches where you actually uploaded the file. If you are still stuck, log back into your file manager and confirm the PDF is there and has the exact name you used in the link code.

Frequently Asked Questions

Can I link to a PDF without uploading it to my own server?

Yes. If the PDF is already hosted somewhere else — on Google Drive, Dropbox, or another website — you can link directly to it using its full web address. Right-click the PDF file and copy the shareable link, then use that URL in your href. This works as long as the file stays where it is and the link does not change.

What happens if someone clicks the PDF link on their phone?

Most phones open PDFs in the browser's built-in viewer. Some phones download the file instead. You cannot control this — it depends on the phone's settings and browser. The link works the same way; the device just handles it differently than a computer would.

Can I password-protect a PDF link?

The link itself cannot be password-protected, but you can password-protect the PDF file before uploading it. Use a tool like Adobe Acrobat or a free alternative like PDFtk to add a password to the file. When someone downloads it, they will need the password to open it.

Does the PDF file size matter?

Large PDFs take longer to download and may time out on slow connections. If your PDF is over 10 MB, consider compressing it first using an online tool or your PDF software. Smaller files load faster and frustrate fewer readers.

What if I want the PDF to open in a new tab instead of the same window?

Add target="_blank" to your link: <a href="pdfs/guide.pdf" target="_blank">Download our guide</a>. This opens the PDF in a new browser tab, leaving your original page open behind it.