---
title: "Difference between char, varchar and nvarchar in sql server"  
description: "char, varchar and nvarchar are SQL Server data type that used for allocated memory in storage device. But there is little difference between them whic"  
author: "AVADHESH PATEL"  
published: 2013-04-05  
updated: 2014-09-18  
canonical: https://www.mindstick.com/blog/479/difference-between-char-varchar-and-nvarchar-in-sql-server  
category: "database"  
tags: ["database"]  
reading_time: 2 minutes  

---

# Difference between char, varchar and nvarchar in sql server

char, [varchar and nvarchar](https://www.mindstick.com/forum/721/different-between-char-varchar-and-nvarchar) are [SQL Server](https://www.mindstick.com/articles/12999/what-is-table-valued-function-in-sql-server) data type that used for allocated memory in [storage device](https://answers.mindstick.com/qa/97217/explain-the-difference-between-primary-and-secondary-storage-device). But there is little [difference between them](https://www.mindstick.com/forum/23342/what-are-jsf-servlet-and-jsp-and-what-is-difference-between-them) which described below:

##### char

It stores fixed length of character. For example if you declare char (10) then it allocates memory for 10 characters. If you store 5 character words then it stores it in 5 characters memory location and other 5 character's memory location will be wasted. Per character, it takes 1 Byte memory.

##### varchar

varchar is flexible data type means it allocates memory as per [data stored](https://www.mindstick.com/forum/33481/in-objective-c-how-to-dump-data-stored-obj-c-object) into this. If you specify varchar(10) at the time of declaration then it allocates 0 memory location at the starting if you specify, it can be null. When you store 5 characters word it will allocate memory for 5 characters and store into that. So there will be no [memory loss](https://www.mindstick.com/blog/301030/memory-loss-when-to-seek-to-help). It stores only non-[unicode characters](https://answers.mindstick.com/qa/35625/can-you-name-some-different-text-file-formats-for-storing-unicode-characters) means for English language only. Per character, it takes 1 Bytes memory.

##### nvarchar

nvarchar means unicode variable characters. When you want to store [international](https://yourviews.mindstick.com/view/85496/celebration-of-international-chocolate-day) character in database then used nvarhcar. It used really because it increases database size twice than varchar datatype because it takes 2 Bytes memory for each character.

---

Original Source: https://www.mindstick.com/blog/479/difference-between-char-varchar-and-nvarchar-in-sql-server

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
