How to Customize or Remove the Headers and Footers of a Notepad Text File

00_lead_image_header_on_notepad_file

By default, each Notepad document has the name of the document in the header and the page number in the footer when you print a text file. However, you can customize the header and footer with special commands or custom text, or leave one or both blank.

The header and footer in Notepad are only visible on a printed text file, not in the Notepad program itself. To customize the header and footer in Notepad, select “Page Setup” from the “File” menu.

01_selecting_page_setup_from_file_menu

On the Page Setup dialog box, enter the text you want in the header and footer in their respective boxes. You can also use the following strings to insert specific data:

  •  &f : Print the name of the document
  •  &d : Print the current date
  •  &t : Print the current time

There are also commands that allow you to specify how the text is aligned in the header and footer.

  •  &l : Left align the characters that follow (that’s a lowercase “L” after the ampersand)
  •  &c : Center the characters that follow
  •  &r : Right align the characters that follow

For example, I entered the following line in the Header box.

&l&f&rLori Kaufman - &d

This will left align the name of the document and right align my name, a dash, and the date. I kept the default footer containing the page number.

If you don’t want any text in the header or footer, delete all the text in the Header and Footer edit boxes (or one or the other if you want only one blank). For example, maybe you want page numbers on the bottom of each page, but don’t need anything at the top of the page. In that case, delete all the text in the Header edit box to leave the header blank.

NOTE: Unlike headers and footers in Microsoft Word, you cannot have different headers and footers in the same Notepad document.

Click “OK” once you’ve set up your header and footer.

02_changing_header

Here’s what my example header looks like:

02a_header_on_notepad_file

If you don’t specify an alignment command, the text is automatically centered. For example, if I entered the following text into the Header box, some of the text will overlap, as shown below.

&f&rLori Kaufman - &d

I didn’t tell Notepad to left align the document name.

02b_overlapping_header_text

Once you set the header and footer, it is saved and applied to any document you open in Notepad from then on. The text you assign to the header and footer is saved in the registry once you close Notepad. This makes it quick and easy to reset the header and footer to their default values. You can reset the header and footer manually by entering the following default values into the edit boxes on the Page Setup dialog box.

  • Header: &f
  • Footer: Page &p

However, we’ll show you how to reset the header and footer in Notepad to the default settings using the Registry Editor and also provide downloadable registry hacks to make it really easy to do.

Standard warning: The Registry Editor is a powerful tool and misusing it can render your system unstable or even inoperable. This is a pretty simple hack and as long as you stick to the instructions, you shouldn’t have any problems. That said, if you’ve never worked with it before, consider reading about how to use the Registry Editor before you get started. And definitely back up the Registry (and your computer!) before making changes.

Open the Registry Editor by hitting Start and typing “regedit.” Press Enter to open Registry Editor and give it permission to make changes to your PC.

03_opening_regedit

In the Registry Editor, use the left sidebar to navigate to the following key:

HKEY_CURRENT_USER\Software\Microsoft\Notepad

In the right pane, there are two values that store the values for the header and footer in Notepad: szHeader and szTrailer , respectively. Click on the value you want to delete and press the “Delete” key.

04_selecting_header_value

The Confirm Value Delete dialog box displays asking if you’re sure you want to permanently delete this value. Click “Yes”. To delete the other value, select it, press “Delete”, and then click “Yes” on the confirmation dialog box.

05_confirm_value_delete_dialog

You can also reset all the settings in Notepad back to default settings, including the header and footer.

If you’re not comfortable editing the Registry yourself, we’ve created a downloadable registry hack you can use to delete the “szHeader” and “szTrailer” values under the Notepad key. We’ve included three .reg files: one for deleting both values, one for deleting just the value for the header (szHeader), and one for deleting just the value for the footer (szTrailer). Extract the .zip file, double-click the appropriate .reg file for what you want to reset, and click through the prompts.

Registry hacks for resetting Notepad’s header and footer

if you enjoy working with the Registry, it’s worth taking the time to learn how to make your own Registry hacks.

Lori Kaufman is a writer who likes to write geeky how-to articles to help make people's lives easier through the use of technology. She loves watching and reading mysteries and is an avid Doctor Who fan.