What is the maximum number of characters that nvarchar(MAX) will hold?

Max. capacity is 2 gigabytes of space – so you’re looking at just over 1 billion 2-byte characters that will fit into a NVARCHAR(MAX) field.

Using the other answer’s more detailed numbers, you should be able to store

(2 ^ 31 - 1 - 2) / 2 = 1'073'741'822 double-byte characters

1 billion, 73 million, 741 thousand and 822 characters to be precise

in your NVARCHAR(MAX) column (unfortunately, that last half character is wasted…)

Update: as @MartinMulder pointed out: any variable length character column also has a 2 byte overhead for storing the actual length – so I needed to subtract two more bytes from the 2 ^ 31 - 1 length I had previously stipulated – thus you can store 1 Unicode character less than I had claimed before.

Leave a Comment