How much binary data can be stored in a registry key value?

holgrave used Ask the Experts™
How much binary data can be stored in a registry key value?

I have a Microsoft object (regobj.dll) that allows me to easily manipulate the registry.

I can use it to store binary data as a key value. But what is the limitation on the size of binary data for each key?
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

The maximum size for any single Registry value entry is 1MB
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

mAmitaiSoftware developper

Whay do you want to do that?
What are you trying to do? There may be a better or differnt way to accomplish your task.

I would suggest not storing that much data in the registry. Instead store the data in a file and store the location of the file in the registry.


Hey ventond - you almost quoted 'the book' word for word!  The link that mcainz2 gave states:

"Generally, data consisting of more than one or two kilobytes (K) should be stored as a file and referred to by using a key in the registry rather than being stored as a value." ;-)

Actually I expect my data to exceed no more than 1K - so I think it is OK.

From the links that mccainz2 gave we can say:

"NT-Server 4.0 the maximum Registry value entry is 1MB."

I have just had a look at the win95rk.hlp - the Win95 Help Guide that comes on the Win95 CD. And it states:

"A value entry has three parts: the data type of the value (which appears as an icon), the name of the value, and the value itself. A value entry cannot be larger than about 64K."

So for Win95 the maximum size of a value is 64K. And it would be SAFE to assume that this same size limit applies to Win98 and ME.

I don't know definately what the limitations are for:

But if I stick to the limit of 64K then I will be OK. And anyway my data is not expected to exceed more than 1K.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial