The simplest way to link to a PDF

To make a PDF link, you upload the PDF file to your website's server, then write a line of code that points to it. The code looks like this: <a href="document.pdf">Click here to read the guide</a>. When someone clicks the text "Click here to read the guide", their browser opens or downloads the PDF depending on their settings.

The file name (document.pdf) must match exactly — including capitalization and the .pdf extension. If you name the file "Document.pdf" but write "document.pdf" in the code, the link will break. The easiest way to avoid this mistake is to keep file names short, lowercase, and without spaces (use hyphens instead, like "rental-guide.pdf").

Where you place the PDF file on your server matters. If the PDF sits in the same folder as the page linking to it, you only need the file name. If it sits in a subfolder called "downloads", the code becomes <a href="downloads/document.pdf">Click here</a>. Most website builders handle this automatically — you upload the file through their interface and they generate the code for you.

Key Takeaways

  • A PDF link is one line of HTML code that points to a file on your server; the simplest version is <a href="filename.pdf">link text</a>.
  • The file name in your code must match the actual file name exactly, including capitalization and the .pdf extension.
  • Most website builders (WordPress, Wix, Squarespace) let you upload PDFs and generate the code without writing HTML yourself.
  • You can control whether the PDF opens in the browser or downloads to the user's computer by adding target="_blank" to the code.
  • If your PDF contains sensitive information, consider password-protecting it or hosting it on a private server rather than making it publicly accessible.

Using your website builder's built-in link tool

If you use WordPress, Wix, Squarespace, or another website builder, you do not need to write code. Upload the PDF through the Media or Files section, then highlight the text you want to turn into a link and click the link button (usually a chain icon). A dialog box appears where you can search for and select your PDF file. The builder writes the code for you.

In WordPress, go to Media → Add New, upload your PDF, copy the file URL (the web address), then paste it into the link dialog on any page. In Wix, use the Add → File section to upload, then link to it from your text. Squarespace works similarly — upload through the File Block and link from there. Each builder stores PDFs in its own folder structure, so you never need to think about where the file actually sits.

Controlling how the PDF opens

By default, clicking a PDF link opens the file in the browser window. Some users prefer to read the file instead. To force a read, add read to your code: <a href="document.pdf" read>read the guide</a>. The browser will save the file to the user's Downloads folder rather than opening it.

To open the PDF in a new browser tab instead of replacing the current page, add target="_blank": <a href="document.pdf" target="_blank">Read the guide</a>. You can combine both: <a href="document.pdf" read target="_blank">read the guide</a>. Most website builders offer these options in their link dialog without requiring you to edit code directly.

Privacy and security considerations for PDF links

A PDF link that anyone can click is a public link — anyone with the web address can access the file. If your PDF contains personal information, financial details, or other sensitive data, do not put it on a public server. Instead, use a password-protected PDF or host it on a private server that requires login.

To password-protect a PDF, use your document editor (Google Docs, Microsoft Word, or a dedicated PDF tool like PDFtk or iLovePDF). Most editors have an Export as PDF option with security settings. You set a password that users must enter before viewing. This prevents casual sharing but does not stop someone determined to crack the password.

Another option is to host the PDF behind a login page. WordPress plugins like Restrict Content Pro or MemberPress let you upload PDFs and make them visible only to logged-in users. This is stronger than password protection because the file itself never leaves your server unencrypted. The trade-off is that users must create an account, which adds friction.

Testing your PDF link before publishing

Before you share a link publicly, test it yourself. Click the link from the same page where it appears. Does it open or read? Does it show the right file? Try it from a different device or browser to catch problems early. If the link is broken, users will see a 404 error (file not found) or a blank page.

Common mistakes: the file name does not match (you wrote "guide.pdf" but the file is "Guide.pdf"), the file is in a subfolder you forgot to include in the path, or you moved the file after creating the link. If you rename or move a PDF, all links to it break. Plan your file structure before you start linking — create a "downloads" or "resources" folder and keep PDFs there consistently.

Linking to PDFs hosted elsewhere

You can link to a PDF on someone else's server. Copy the full web address (URL) of the PDF and paste it into your link code: <a href="https://example.com/document.pdf">Read the guide</a>. This works as long as the file stays where it is. If the other site moves or deletes the file, your link breaks and you have no control over it.

Linking to external PDFs is useful when you want to reference a government document, research paper, or resource you do not own. The downside is that you depend on the other site to keep the file available. For documents you control, always host them on your own server so you can update or move them without breaking links across the web.

Making PDF links accessible to all users

When you create a link to a PDF, use descriptive link text instead of "Click here" or "read". Write something like "Read our rental rights guide (PDF)" so users know what they are opening before they click. This helps people using screen readers understand the link's purpose.

If your PDF is large (over 5 MB), mention the file size in the link text: "read our privacy policy (PDF, 2 MB)". This warns users on slow connections or mobile data that the read will take time. If the PDF is a scanned image rather than searchable text, note that too: "View our lease template (PDF, scanned image)" so users know they cannot copy text from it.

Frequently Asked Questions

Can I see how many people clicked my PDF link?

Website analytics tools like Google Analytics track clicks to PDFs if you set them up correctly. By default, Google Analytics may not record PDF downloads. You can add tracking code to your link or use a URL shortener (like Bit.ly) to count clicks. Most website builders have built-in analytics that show which files were downloaded, though the detail varies by platform.

What if someone downloads my PDF and shares it without permission?

Once a file is downloaded, you cannot control where it goes. If the PDF contains confidential information, password-protect it or host it behind a login. For public documents, accept that sharing happens — it is often free marketing. If you need to track who accessed a document, use a login system and log access on your server.

Do I need to convert my Word document to PDF before linking to it?

Yes, links work with any file type (.docx, .pdf, .xlsx), but PDFs are better for sharing because they look the same on every device and cannot be edited accidentally. Convert Word documents to PDF using File → Export as PDF in Microsoft Word or Google Docs. This ensures readers see exactly what you intended, regardless of what fonts or software they have installed.

Can I link to a specific page inside a PDF?

Yes, but it requires adding a page number to the URL: <a href="document.pdf#page=5">Jump to page 5</a>. Not all browsers support this, and it does not work reliably across all devices. For better control, consider breaking a long PDF into separate files or using a table of contents with internal links within the PDF itself.

What is the difference between linking to a PDF and embedding one?

A link lets users open or read the PDF in a separate window. Embedding displays the PDF directly on your webpage so users can read it without leaving. Embedding requires more code and can slow down your page. Links are simpler and let users choose whether to read. Use links for most cases unless you want readers to preview the PDF without leaving your site.