Empty notepad text file has greater size than 0 bytes (3 bytes)

Why does empty text file created in Windows Notepad have file size greater than 0 bytes ? My one does not contain any text content, but it has 3 bytes.
0
give a positive ratinggive a negative rating
First, please note there are multiple types of file sizes available in Windows. When you click on the file with the right mouse button and choose Properties, you can see Size and Size on disk. These file sizes are usually different, because there are different calculation methods used.

Size is the actual size of the file in bytes.

Size on disk is the indicator of how much space does a file occupies on the disk drive.

When creating a Notepad text file, the file size depends also on used character encoding. You can choose which encoding to use when saving the file, at the bottom part of the window. There should be available at least ANSI and UTF-8 encoding. Depending on Windows version there can be also Unicode or UTF-16.

If you save an empty Notepad text file using ANSI encoding, its file size should be 0 bytes. When you use UTF-8 or UTF-16 encoding, the file size should be greater. It should be 2 - 3 bytes.

The reason why empty file can have the file size greater than 0 bytes is, that each encoding is using a different method to store a content. It means there can be added some content that you can't read or modify, like end-of-line characters, line breaks or other file related information.

When you change the character encoding, it should have impact on the file content, for example some characters may be not displayed correctly.
Share on FacebookShare on TwitterShare on LinkedInSend email
1 answer
x
x
2024 AnswerTabsTermsContact us