PDF Editing Issues

Fix PDF Hyperlinks with Hash Symbols Returning 404 Errors

Jason MillerJason Miller Nov 2, 2026 869 views

Question details

Hyperlinks containing a hash (#) fragment work correctly when a PDF is viewed locally, but return a 404 error after the PDF is uploaded to a website.

How to Fix PDF Hyperlinks with Hash Symbols Returning 404 Errors
Product
PDF
Device & OS
not provided
Scenario
Clicking a hyperlink with a hash fragment (anchor link) inside a hosted online PDF document.
Observed behavior
The browser returns a 404 Not Found error because the hash symbol is misinterpreted, stripped, or incorrectly URL-encoded when interacting with the web server.
Before you start

Verify the exact web address in a standard browser to ensure the target web page and its anchor link are currently live and functioning properly before editing your PDF.

Solution 1Recommended

Check and Correct URL Encoding in the PDF Editor

Manually inspect the hyperlink properties in your PDF to ensure the hash symbol has not been automatically encoded to '%23'.

A hash symbol (#) identifies a specific location or anchor within a web page and is typically handled by the browser, not the server. If your PDF editor or converter mistakenly URL-encodes the hash symbol into '%23', the web server will interpret it as part of the file name or path, resulting in a 404 error.

1
Open link properties

Open your PDF document in a dedicated PDF editor. Select the 'Edit Link' or 'Link' tool from the toolbar.

2
Inspect the URL

Double-click the broken hyperlink to open the Link Properties or URL Action dialog box.

3
Fix the hash symbol

Look closely at the destination URL. If the address contains '%23' instead of a literal '#', manually type the '#' symbol to replace the encoded characters.

4
Save and test

Click OK to apply the changes, save the PDF, and re-upload it to your website to test the hyperlink.

Check and Correct URL Encoding in the PDF Editor
URL Formatting Rule: Always ensure there are no trailing spaces at the end of the URL or right before the hash symbol, as these can also trigger broken links.
Edit PDF Links Easily

Fix and Manage PDF Hyperlinks with WPS Office

WPS Office provides a comprehensive PDF editing suite that allows you to easily insert, modify, and test hyperlinks directly within your PDF files. It preserves exact URL strings to ensure your links work perfectly both offline and online.

  1. 1. Open your PDF: Launch WPS Office and open the PDF document containing the broken links.
  2. 2. Access link tools: Navigate to the 'Edit' tab on the top ribbon and click on the 'Link' button.
  3. 3. Edit link properties: Double-click the hyperlink area to open the Link Properties dialog. Select 'Open a web link'.
  4. 4. Update the URL: Type or paste your exact URL including the '#' symbol into the destination field, then click OK and save your document.
Easily add, edit, or remove URL links in existing PDFsPreserves accurate URL formatting without unwanted encodingHighly compatible with standard Adobe PDF formatsTest and verify hyperlink paths directly within the application
microsoft office alternative - wps office

Frequently Asked Questions

Why does a hash symbol in a URL cause a 404 error?

A hash symbol (#) is meant to be handled by the user's web browser to jump to a specific section of a page. If a PDF editor or server improperly encodes the '#' into '%23', the web server thinks '%23' is part of the file name. Since no file with that name exists, it returns a 404 Not Found error.

Can I link to a specific page within an online PDF?

Yes, you can link to a specific page of an online PDF by appending '#page=pagenum' to the end of the URL (e.g., example.com/file.pdf#page=4). However, the web server hosting the PDF must support byte-serving (Accept-Ranges) for this to work correctly.

How do I stop my PDF converter from changing # to %23?

This happens when the conversion tool automatically URL-encodes special characters. To prevent this, try recreating the hyperlink in the source document without extra spaces, or use a dedicated PDF editor like WPS Office to manually correct the link destination after conversion.