Add Custom header and footer to Windows Notepad file

Notepad adding custom Header and Footer
Notepad adding custom Header and Footer

For printing a text file using Microsoft Notepad we can add a custom header and footer using the Advance Page Setup feature available under the File menu.

  1. Open Notepad adding custom Header and Footer file with Notepad
  2. Now go to File → Page Setup
  3. You would see Header and Footer Text Boxes
  4. Now add your custom text and with the below keywords,
    1. To insert today's date add : &d
    2. To insert the time add : &t
    3. To insert the page number add : &p
    4. To insert the name of the file : &f
    5. To insert an ampersand (&) symbol add : &&
To align Header and Footer we can use,
  1. &l => To position them left
  2. &r => To position them at right
  3. &c => To position them at the center.
Example if you want a footer to show page as "Page 1", "Page 2" ... and at the center add: &c Page &p
Try Out Code2care Dev Tools:


Code2care is an initiative to publish and share varied knowledge in programming and technical areas gathered during day-to-day learnings and development activities.

Students and software developers can leverage this portal to find solutions to their various queries without re-inventing the wheel by referring to our easy to understand posts. Technical posts might include learnings, tutorials, trouble-shooting steps, video tutorials, code snippets, how-to, blogs, articles, etc.

🎉 We are celebrating the 10th years of Code2care! Thank you for all your support!

We strongly support Gender Equality & Diversity.