I want to insert a null character (ASCII Value 00) into an open file in Notepad. A program that is reading this file is expecting 00 at the end, but it's getting the ASCII value for space - 20.

How can I achieve this?

migrated from stackoverflow.com Oct 28 '09 at 0:11

This question came from our site for professional and enthusiast programmers.

  • 2
    I had hoped that holding Alt and pressing four zero on the numpad would insert the null the same way it inserts all of the fÜn printable characters but it doesn't. – tkryger Oct 26 '09 at 7:06
  • If it did work, you'd only need two zeros, not four. Alt+09 works for Tab, for example. – mbomb007 Mar 13 '17 at 19:38

With Notepad++

  1. Go to Edit > Character Panel to show the ASCII Insertion Panel.

  2. Put the cursor where you want to insert the character.

  3. Double-click the character to insert.

    ASCII Insertion Panel

  • 1
    @DavidPostill It's Notepad++, which is actually what I was searching for when I found this question. – mbomb007 Sep 24 '16 at 18:06
  • That doesn't help when the OP us using Notepad. – DavidPostill Sep 24 '16 at 18:08
  • 4
    @DavidPostill This isn't for the OP anymore. This is for users who find this question when searching. The OP got what he wanted years ago and deleted his account. Besides, this answer is also Notepad++ – mbomb007 Sep 24 '16 at 18:09

With Notepad++

From HEX

  1. Type 00 00 00
  2. Select this text
  3. TextFX > TextFX Convert > Convert Hex to text

From Base64

  1. Type AA==
  2. Select this text
  3. Plugins > MIME Tools > Base64 Decode

The mapping is:

NUL -> AA=
NUL NUL -> AAA=
NUL NUL NUL -> AAAA
  • Your steps don't match your mappings. You say AA== in one place and AA= in another. – mbomb007 Sep 23 '16 at 18:26
  • 1
    Please read the question again carefully. Your answer does not answer the original question. The OP is using Notepad. – DavidPostill Sep 24 '16 at 20:06
  • 2
    @DavidPostill The OP asked for something that is impossible, so it's fine that he provide an alternative method of entering a NUL into a file. – mbomb007 Mar 9 '17 at 14:27

Normal text editors such as Notepad usually do not have the capability to enter NUL characters into files. What you probably want to do is to use a "hex editor" (some text editors also have a "hex" mode). This will let you enter NUL characters, or any other byte you might need.

protected by Community Sep 25 '16 at 15:52

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?