The "data:" URL scheme is only useful
for short values. Note that some
applications that use URLs may impose
a length limit; for example, URLs
embedded within <A> anchors in HTML
have a length limit determined by the
SGML declaration for HTML [RFC1866].
The LITLEN (1024) limits the number of
characters which can appear in a
single attribute value literal, the
ATTSPLEN (2100) limits the sum of all
lengths of all attribute value
specifications which appear in a tag,
and the TAGLEN (2100) limits the
overall length of a tag.
Just an FYI, I was able to load a 130K image using a data url in Firefox 3.5 from a JavaScript ajax call. It truncated the image in IE 8, but the whole thing showed up in FF.
There are a lot of answers. As the question was asked 5+ years ago, most are now incorrect due to becoming dated, yet this question sits at the top of Google results for "data uri limit". Data URIs are now widely supported and IE 7/8 is no longer a relevant browser. There are many references below because the answer is nuanced today.
Data URI Limits
The data URI spec does not define a size limit but says applications may impose their own.
Chrome - 2MB for the current document. Otherwise the limit is the in-memory storage limit for arbitrary blobs: if x64 and NOT ChromeOS or Android, then 2GB; otherwise, total_physical_memory / 5 (source).
I tried the code from waza123 but the charCodeAt method did not convert all characters correctly. Here is my solution for creating large downloads in the browser. (I used it for JSON data)
Note: There are some additional restrictions in IE. For iframe is a limit of 4 kb.
In IE9, the 32kb limit for DataURIs was removed, although for security reasons their use remains limited to certain contexts (specifically, scenarios that create a security context, like IFRAMES, are forbidden)