Other PDF Issues

How to Fix PDF Hyperlinks Changing # to %23 and Causing 404 Errors

Nimra MalikNimra Malik Nov 3, 2026 869 views

Question details

Users need a way to prevent hyperlinks in PDF files from automatically encoding the hash symbol (#) as %23, which breaks URLs with fragment identifiers and results in 404 errors.

How to Fix PDF URLs Changing '#' to '%23' and Causing 404 Errors
Product
PDF
Device & OS
not provided
Scenario
Clicking a hyperlink within an exported PDF document that directs to a web URL containing a hash fragment (e.g., jump-to-section links).
Observed behavior
The web browser interprets the hash symbol (#) as its URL-encoded equivalent (%23), leading to an invalid web address and a 404 Page Not Found error.
Before you start

Ensure you have access to the original source document (such as the Microsoft Word or InDesign file) so you can adjust the export settings and regenerate the PDF.

Solution 1Recommended

Use the 'Save as PDF' Command with Bookmark Options in Word

Exporting the document directly using the built-in Save As feature with specific bookmark options prevents aggressive URL encoding and preserves the hash character.

Avoid using the 'Print to PDF' function, as virtual printers often strip out active hyperlinks or apply generic text encoding that breaks special characters in URLs.

1
Open the Source Document

Launch Microsoft Word and open the document containing your hyperlinks.

2
Navigate to Save As

Click on 'File' in the top-left corner, then select 'Save As' from the left sidebar.

3
Select PDF Format

Choose your save location, and in the 'Save as type' dropdown list, select 'PDF'.

4
Configure PDF Options

Click the 'Options...' button located below the dropdown list to open the settings dialog.

5
Enable Bookmarks

Under the 'Include non-printing information' section, check the box for 'Create bookmarks using' and select either 'Headings' or 'Word bookmarks' depending on your document structure.

6
Save the Document

Click 'OK' to close the options, then click 'Save'. The generated PDF will now retain active hyperlinks with the hash symbol intact.

Use the 'Save as PDF' Command with Bookmark Options in Word
Formatting Change: The converted document may occasionally lose the blue underlined appearance for the text, but the hyperlink will remain fully active and functional when clicked.

Create Flawless PDFs with Intact Hyperlinks Using WPS Office

Avoid frustrating 404 errors and hyperlink encoding bugs. WPS Office features a highly accurate, built-in PDF exporter that seamlessly transitions your documents into PDFs while perfectly preserving links, bookmarks, and layout formatting.

  1. 1. Open Your Document in WPS Writer: Launch WPS Office and open your source text document containing the hyperlinks.
  2. 2. Access the Export Tool: Navigate to the 'Menu' button in the top left corner and select 'Export to PDF'.
  3. 3. Configure Export Settings: In the dialog box, click on 'Advanced Settings' and ensure that 'Convert cross-references and table of contents to links' is checked.
  4. 4. Generate the PDF: Click 'Export to PDF'. WPS Office will accurately compile your document, keeping all special characters in your URLs completely intact.
100% free and lightweight complete office suiteFully compatible with Microsoft Word (.doc, .docx) formatsBuilt-in 'Export to PDF' tool perfectly preserves complex URLs and hash fragmentsIncludes a robust PDF editor for modifying hyperlinks directly within the PDF
microsoft office alternative - wps office

Frequently Asked Questions

Why does the '#' symbol turn into '%23' in my PDF links?

The string '%23' is the standard HTML URL-encoded equivalent of the hash (#) symbol. Some PDF creation tools and print drivers aggressively encode special characters to ensure web compatibility, unintentionally breaking fragment identifiers meant for the browser to read.

Does using 'Print to PDF' fix the hyperlink issue?

No. In most cases, 'Print to PDF' either flattens the document (removing active hyperlinks entirely) or uses generic encoding that causes this exact issue. It is always recommended to use a dedicated 'Save As PDF' or 'Export to PDF' function.

How can I edit a broken link directly inside an existing PDF?

If you don't have the source file, you can use a dedicated PDF Editor like WPS PDF. Open the file, go to the 'Edit' tab, select 'Link', double-click the broken hyperlink, and manually change the '%23' back to a '#' in the destination URL box.